/* =====================================================
   pfx Task – Design System
   ===================================================== */

:root {
    --primary:       #7B3FA0;
    --primary-dark:  #6a329a;
    /* Bootstrap 5 overrides */
    --bs-primary:             #7B3FA0;
    --bs-primary-rgb:         123,63,160;
    --bs-btn-bg:              #7B3FA0;
    --bs-btn-border-color:    #7B3FA0;
    --bs-btn-hover-bg:        #6a329a;
    --bs-btn-hover-border-color: #6a329a;
    --bs-btn-active-bg:       #5c2a86;
    --bs-link-color:          #7B3FA0;
    --bs-link-hover-color:    #6a329a;
    --success:       #198754;
    --success-dark:  #146c43;
    --warning:       #ffc107;
    --info:          #0dcaf0;
    --navy:          #1a1f36;
    --navy-mid:      #2d3748;
    --surface:       #f8f9fa;
    --border:        #dee2e6;
    --radius-sm:     0.375rem;
    --radius-md:     0.5rem;
    --radius-lg:     0.75rem;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow-md:     0 4px 12px rgba(0,0,0,.10);
    --shadow-lg:     0 12px 40px rgba(0,0,0,.18);
    --transition:    0.2s ease;
}

/* ── Base ────────────────────────────────────────── */
body {
    background-color: var(--surface);
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ──────────────────────────────────────── */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

/* ── Cards ───────────────────────────────────────── */
.card {
    border-color: var(--border);
    border-radius: var(--radius-lg);
}

.card-header {
    border-bottom-color: var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

/* ── Stat Cards ──────────────────────────────────── */
.stat-card {
    border-left: 4px solid;
    border-radius: var(--radius-lg);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

/* ── Status Panel (Log) ──────────────────────────── */
.status-inprogress::before { background: #7B3FA0; animation: pulse 2s infinite; }
.status-panel {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff;
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.status-log-content {
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Cascadia Code', 'Fira Mono', 'Courier New', monospace;
    font-size: 0.72rem;
    background: rgba(0,0,0,.25);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

.status-log-content .log-entry {
    margin-bottom: 0.15rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 0.8125rem;
}

.status-log-content .log-success { color: #4ade80; }
.status-log-content .log-error   { color: #f87171; }
.status-log-content .log-info    { color: #60a5fa; }

/* ── Preview Box ─────────────────────────────────── */
.preview-box {
    background: var(--surface);
    border: 1.5px dashed #adb5bd;
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 160px;
    max-height: 210px;
    overflow-y: auto;
    transition: border-color var(--transition), background var(--transition);
}

.preview-box.has-content {
    border-style: solid;
    border-color: var(--primary);
    background: #fff;
    box-shadow: inset 0 0 0 2px #7B3FA0;
}

/* ── Tables ──────────────────────────────────────── */
.table {
    font-size: 0.9375rem;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.6px;
    color: #6c757d;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: rgba(123,63,160,.04);
}

/* ── Status Badges ───────────────────────────────── */
.badge-status {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.badge-ausstehend {
    background-color: #fff8e1;
    color: #795700;
    border: 1px solid #ffe082;
}

.badge-gesendet {
    background-color: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    --bs-btn-bg:              #7B3FA0;
    --bs-btn-border-color:    #7B3FA0;
    --bs-btn-hover-bg:        #6a329a;
    --bs-btn-hover-border-color: #6a329a;
    --bs-btn-active-bg:       #5c2a86;
    --bs-btn-focus-shadow-rgb: 123,63,160;
    background: linear-gradient(135deg, #7B3FA0 0%, #6a329a 100%) !important;
    border-color: #7B3FA0 !important;
    box-shadow: 0 2px 6px rgba(123,63,160,.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #6a329a 0%, #5c2a86 100%) !important;
    border-color: #6a329a !important;
    box-shadow: 0 4px 12px rgba(123,63,160,.4);
    filter: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    border: none;
    box-shadow: 0 2px 6px rgba(25,135,84,.3);
}

.btn-success:hover {
    filter: brightness(1.07);
}

/* ── Form Controls ───────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: #c39fd4;
    box-shadow: 0 0 0 0.2rem rgba(123,63,160,.15);
}

textarea.form-control {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.55;
    resize: vertical;
}

/* ── Toast ───────────────────────────────────────── */
.toast {
    background: #fff;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ── Spinner ─────────────────────────────────────── */
.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.125rem;
}

/* ── Animations ──────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.fade-in {
    animation: fadeIn 0.25s ease-out both;
}

.shake {
    animation: shake 0.5s ease-in-out both;
}

/* ── Misc ────────────────────────────────────────── */
.form-check-input { cursor: pointer; }

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* ── In Bearbeitung (In Work) ────────────────────── */
.in-work-header {
    background: linear-gradient(135deg, rgba(123,63,160,0.08) 0%, rgba(123,63,160,0.04) 100%) !important;
    border-top: 2px solid rgba(123,63,160,0.3);
    border-bottom: 1px solid rgba(123,63,160,0.15);
}

.in-work-header td {
    font-weight: 500;
}

.in-work-row {
    background-color: rgba(123,63,160,0.04) !important;
    border-left: 3px solid var(--primary);
}

.in-work-row:hover {
    background-color: rgba(123,63,160,0.08) !important;
}

.shared-task-row {
    background-color: rgba(13, 202, 240, 0.06) !important;
    box-shadow: inset 3px 0 0 rgba(13, 202, 240, 0.65);
}

.shared-task-row:hover {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

.shared-task-row.in-work-row {
    background:
        linear-gradient(90deg, rgba(13, 202, 240, 0.1), rgba(123,63,160,0.04)) !important;
    box-shadow: inset 3px 0 0 rgba(13, 202, 240, 0.75);
}

.shared-task-card {
    background: #f2fbfd;
    border-color: rgba(13, 202, 240, 0.35);
    box-shadow: inset 3px 0 0 rgba(13, 202, 240, 0.75), var(--shadow-sm);
}

.shared-task-card:hover {
    background: #eaf9fc;
}

.pin-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.pin-btn:hover {
    transform: scale(1.1);
}

.pin-btn:active {
    transform: scale(0.95);
}

.pin-btn.btn-primary {
    box-shadow: 0 2px 4px rgba(123,63,160,0.3);
}

.task-row-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.task-header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .task-row-main {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.settings-switch .form-check-input {
    width: 2.75rem;
    height: 1.45rem;
}

.settings-switch .form-check-label {
    padding-left: 0.35rem;
}

.ai-provider-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.35rem;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.ai-provider-option {
    min-height: 2.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: #495057;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.ai-provider-option:hover {
    background: #fff;
    border-color: rgba(var(--bs-primary-rgb), 0.22);
    color: var(--primary);
}

.ai-provider-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #adb5bd;
    flex: 0 0 auto;
}

.btn-check:checked + .ai-provider-option {
    background: #fff;
    border-color: rgba(var(--bs-primary-rgb), 0.36);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-check:checked + .ai-provider-option .ai-provider-dot {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.14);
}

.btn-check:focus-visible + .ai-provider-option {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

.ai-key-delete-column {
    padding-top: 1.9rem;
}

@media (max-width: 575.98px) {
    .ai-provider-picker {
        grid-template-columns: 1fr;
    }

    .ai-key-delete-column {
        padding-top: 0;
    }
}

/* ── Rich Text Editor ─────────────────────────────── */
.rich-text-editor {
    cursor: text;
}

.rich-text-editor a {
    color: var(--primary) !important;
    text-decoration: underline !important;
    cursor: pointer;
}

.rich-text-editor a:hover {
    color: var(--primary-dark) !important;
}

.rich-text-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(123,63,160,0.25);
    outline: 0;
}

/* ── Login Overlay ───────────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    isolation: isolate;
}

.login-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease-out both;
}

/* Brand Section */
.login-brand {
    text-align: center;
}

.brand-logo {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    overflow: hidden;
    border-radius: 14px;
    flex-shrink: 0;
}

.brand-logo img {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
    color: #1a1f36;
}

.brand-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
    margin-bottom: 0;
}

/* Login Card */
.login-card {
    background: #fff;
    padding: 1.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    border: 1px solid #e9ecef;
    width: 100%;
}

/* Form Controls inside card */
.login-card .form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123,63,160,0.12);
    background: #fff;
    outline: none;
}

.password-field {
    position: relative;
}

/* Login Button */
.btn-login {
    border-radius: var(--radius-md);
    padding: 0.8rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform .2s, box-shadow .2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(123,63,160,0.35);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Checkbox purple */
.login-card .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Input group focus border sync */
.login-card .input-group:focus-within span.input-group-text {
    border-color: var(--primary) !important;
}
.login-card .input-group:focus-within input.form-control {
    border-color: var(--primary) !important;
    box-shadow: none;
}

/* Copyright */
.login-copyright {
    text-align: center;
    color: #adb5bd;
}

/* Standalone auth page */
.auth-page-body {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    color: #1a1f36;
    background: #111827;
    isolation: isolate;
}

.auth-page-body::before {
    content: "";
    position: fixed;
    inset: -32%;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(118deg, #111827 0%, #381958 29%, #0f766e 61%, #172554 100%);
    background-size: 230% 230%;
    animation: authGradientShift 18s ease-in-out infinite;
}

.auth-page-body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.06) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.18) 0 1px, transparent 1.5px);
    background-size: 84px 84px, 84px 84px, 28px 28px;
    -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,0.18), #000 26%, #000 72%, rgba(0,0,0,0.22));
    mask-image: linear-gradient(135deg, rgba(0,0,0,0.18), #000 26%, #000 72%, rgba(0,0,0,0.22));
    animation: authPatternDrift 24s linear infinite;
}

.auth-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    align-items: center;
    gap: 2rem;
}

.auth-context-panel {
    position: relative;
    min-height: 590px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: #f8fafc;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.13), rgba(255,255,255,0.05)),
        linear-gradient(135deg, rgba(123,63,160,0.34), rgba(13,202,240,0.12) 45%, rgba(25,135,84,0.16));
    box-shadow: 0 34px 90px rgba(0,0,0,0.26);
    backdrop-filter: blur(20px);
}

.auth-context-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.75;
    background:
        linear-gradient(120deg, rgba(255,255,255,0.16) 0 1px, transparent 1px 42px),
        linear-gradient(60deg, rgba(134,239,172,0.16), transparent 38%, rgba(125,211,252,0.12));
    background-size: 42px 42px, auto;
}

.auth-context-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 2.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-context-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: #d9f99d;
    background: rgba(15,23,36,0.24);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-context-panel h2 {
    max-width: 560px;
    margin: 0;
    color: #fff;
    font-size: 2.15rem;
    line-height: 1.12;
    font-weight: 760;
    letter-spacing: 0;
}

.auth-context-panel p {
    max-width: 560px;
    margin: 1rem 0 0;
    color: #d5e0ee;
    font-size: 1rem;
    line-height: 1.65;
}

.auth-flow-preview {
    width: min(100%, 450px);
    display: grid;
    gap: 0.7rem;
    margin: 2rem 0 1.5rem;
}

.auth-flow-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    background: rgba(15,23,36,0.34);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.auth-flow-row span {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #86efac;
    background: rgba(134,239,172,0.11);
}

.auth-flow-row strong {
    min-width: 0;
    color: #fff;
    font-size: 0.98rem;
    line-height: 1.2;
}

.auth-flow-row small {
    min-width: 0;
    color: #b9c8dc;
    line-height: 1.35;
}

.auth-flow-row.is-active {
    border-color: rgba(134,239,172,0.32);
    background: rgba(134,239,172,0.13);
}

.auth-context-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.auth-context-pills span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 8px;
    color: #e5edf8;
    background: rgba(255,255,255,0.08);
    font-size: 0.82rem;
    font-weight: 650;
}

.auth-form-panel {
    width: 100%;
    max-width: 430px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    justify-self: center;
}

.auth-page-body .login-brand {
    color: #fff;
}

.auth-page-body .brand-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 0.85rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.14);
    box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}

.auth-page-body .brand-logo img {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    border-radius: 8px;
}

.auth-page-body .brand-title {
    color: #fff;
    letter-spacing: 0;
}

.auth-page-body .brand-subtitle {
    color: #cbd7e8;
}

.auth-page-body .login-card {
    padding: 2rem;
    border: 1px solid rgba(226,232,240,0.88);
    border-radius: 8px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 26px 80px rgba(0,0,0,0.28);
    backdrop-filter: blur(16px);
}

.auth-page-body .login-card .form-control,
.auth-page-body .login-card .input-group-text {
    border-color: #d8e0ec !important;
    background: #fff !important;
}

.auth-page-body .login-card .form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(123,63,160,0.13);
}

.auth-page-body .btn-login {
    border: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
    box-shadow: 0 12px 28px rgba(79,70,229,0.28);
}

.auth-page-body .btn-login:hover {
    box-shadow: 0 16px 34px rgba(15,118,110,0.32);
}

.auth-page-body .login-copyright p {
    color: rgba(226,232,240,0.8) !important;
}

@keyframes authGradientShift {
    0%, 100% {
        background-position: 0% 44%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 56%;
        transform: scale(1.03);
    }
}

@keyframes authPatternDrift {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 84px 84px, -84px 84px, 28px 28px;
    }
}

@media (max-width: 991.98px) {
    .auth-login-shell {
        max-width: 520px;
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
        padding: 1.5rem;
    }

    .auth-context-panel {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-login-shell {
        padding: 1rem;
    }

    .auth-form-panel {
        gap: 0.85rem;
    }

    .auth-page-body .login-card {
        padding: 1.35rem;
    }

    .auth-page-body .brand-logo,
    .auth-page-body .brand-logo img {
        width: 56px;
        height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page-body::before,
    .auth-page-body::after {
        animation: none !important;
    }
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb  { background: #c8c8c8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ── KI-Formular ─────────────────────────────────── */
#aufgabeFormWrapper {
    min-height: 280px;
}

#aufgabeFormPlaceholder {
    min-height: 280px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

#aufgabeForm .form-control,
#aufgabeForm .form-select {
    background-color: #fffdf4;
    border-color: #e8d98a;
}

#aufgabeForm .form-control:focus,
#aufgabeForm .form-select:focus {
    background-color: #fff;
    border-color: #c39fd4;
    box-shadow: 0 0 0 0.2rem rgba(123,63,160,.15);
}

/* ── Searchable Dropdown ─────────────────────────── */
.sd-wrapper {
    position: relative;
}
.sd-control {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    min-height: 2rem;
    user-select: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.sd-control:hover { border-color: #adb5bd; }
.sd-control.open, .sd-control:focus-within {
    border-color: #c39fd4;
    box-shadow: 0 0 0 0.2rem rgba(123,63,160,.15);
    outline: none;
}
.sd-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #212529;
}
.sd-label.placeholder { color: #6c757d; }
.sd-clear {
    display: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    color: #adb5bd;
    line-height: 1;
    cursor: pointer;
}
.sd-clear:hover { color: #dc3545; }
.sd-caret { color: #6c757d; font-size: 0.7rem; flex-shrink: 0; transition: transform .15s; }
.sd-control.open .sd-caret { transform: rotate(180deg); }

.sd-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1050;
    max-height: 260px;
    display: none;
    flex-direction: column;
}
.sd-dropdown.open { display: flex; }

.sd-search-wrap {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sd-search {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    outline: none;
}
.sd-search:focus { border-color: #c39fd4; box-shadow: 0 0 0 0.15rem rgba(123,63,160,.15); }

.sd-list {
    overflow-y: auto;
    flex: 1;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
}
.sd-list li {
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-list li:hover, .sd-list li.focused { background: #f0f4ff; }
.sd-list li.selected { background: #e7f0ff; font-weight: 600; }
.sd-list li.sd-empty { color: #6c757d; cursor: default; font-style: italic; }
.sd-list li.sd-empty:hover { background: none; }

/* ── Clickable table rows ────────────────────────── */
.dash-row td { vertical-align: middle; }
.dash-row:hover { background-color: rgba(13,110,253,.04) !important; }

.dash-cell-generic {
    max-width: 260px;
    min-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-cell-dynamic-field {
    font-size: 0.82rem;
}

.dash-cell-custom-field {
    font-size: 1.08rem;
    font-weight: 650;
    color: #4b5563;
}

.pfx-context-menu {
    position: fixed;
    z-index: 1080;
    min-width: 190px;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.pfx-context-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #212529;
    font-size: 0.875rem;
    text-align: left;
}

.pfx-context-menu-item:hover,
.pfx-context-menu-item:focus {
    background: rgba(123,63,160,.08);
    color: var(--primary);
    outline: none;
}

.pfx-column-chooser {
    display: grid;
    gap: 0.85rem;
}

.pfx-column-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.pfx-column-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 38px;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid #eef1f4;
    background: #f8f9fa;
}

.pfx-column-section-title {
    margin: 0;
    color: #495057;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pfx-column-section-hint {
    color: #6c757d;
    font-size: 0.75rem;
}

.pfx-column-list {
    max-height: min(58vh, 520px);
    overflow: auto;
    background: #fff;
}

.pfx-column-item {
    display: grid;
    grid-template-columns: 32px 34px minmax(0, 1fr);
    align-items: center;
    min-height: 46px;
    padding: 0.35rem 0.65rem;
    border-bottom: 1px solid #eef1f4;
    background: #fff;
}

.pfx-column-item:last-child {
    border-bottom: 0;
}

.pfx-column-item.dragging {
    opacity: 0.55;
}

.pfx-column-item.drag-over {
    box-shadow: inset 0 2px 0 var(--primary);
}

.pfx-column-item.is-hidden {
    background: #fafbfc;
}

.pfx-column-drag {
    color: #98a2b3;
    cursor: grab;
    font-size: 1rem;
}

.pfx-column-drag:active {
    cursor: grabbing;
}

.pfx-column-item[draggable="false"] .pfx-column-drag {
    cursor: default;
}

.pfx-column-name {
    min-width: 0;
    overflow: hidden;
}

.pfx-column-name strong {
    display: block;
    color: #1f2937;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pfx-column-name code {
    display: block;
    color: #6c757d;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Pagination compact ──────────────────────────── */
.pagination .page-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.875rem;
    min-width: 2.25rem;
    text-align: center;
}

/* ── Card footer wrap ────────────────────────────── */
.card-footer { flex-wrap: wrap; gap: 0.5rem; }

/* ── Action buttons never full-width ─────────────── */
.btn-action { width: auto !important; margin-bottom: 0 !important; }

/* ── Responsive ──────────────────────────────────── */

/* xs – phones (< 576px) */
@media (max-width: 575.98px) {
    body { font-size: 0.9375rem; }
    .container-fluid { padding-left: 0.6rem; padding-right: 0.6rem; }

    .navbar { padding-top: 0.4rem; padding-bottom: 0.4rem; }
    .navbar-brand { font-size: 1rem; }

    /* Login overlay */
    .login-overlay { padding: 0.75rem; }
    .login-container { gap: 1rem; }

    /* Login brand */
    .brand-logo { width: 56px; height: 56px; }
    .brand-logo i { font-size: 1.75rem; }
    .brand-title { font-size: 1.25rem; }
    .brand-subtitle { font-size: 0.8rem; }

    /* Login card */
    .login-card { padding: 1.5rem 1.25rem; }
    .login-header { margin-bottom: 1.25rem; }
    .login-icon { width: 48px; height: 48px; }
    .login-icon i { font-size: 1.5rem; }
    .login-header h2 { font-size: 1.125rem; }

    /* Login form */
    .login-card .form-floating > .form-control {
        height: calc(3.25rem + 2px);
        padding: 0.875rem 0.875rem 0.375rem 2.5rem;
        font-size: 0.875rem;
    }
    .login-card .form-floating > label {
        padding: 0.875rem 0.875rem 0.375rem 2.5rem;
    }
    .login-card .form-floating > label i {
        left: -1.5rem;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }

    .btn-login {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .login-footer { margin-top: 1.25rem; padding-top: 1rem; }

    /* Card header */
    .card-header h5 { font-size: 0.9rem; }
    .card-header, .card-footer { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* Table tighter */
    .table td, .table th { padding: 0.3rem 0.4rem; font-size: 0.875rem; }

    /* Status log */
    .status-log-content { max-height: 90px; }

    /* Stat cards: 2×2 */
    .stat-card { margin-bottom: 0; }
    .stat-card h2 { font-size: 1.5rem; }

    /* Filter bar: stack to 2 cols */
    .card-body .row > .col-9 { flex: 0 0 75%; max-width: 75%; }
    .card-body .row > .col-3 { flex: 0 0 25%; max-width: 25%; }
}

/* sm – landscape phones (576–767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container-fluid { padding-left: 0.875rem; padding-right: 0.875rem; }
    .table td, .table th { padding: 0.35rem 0.5rem; }
}

/* Touch: larger hit areas */
@media (hover: none) and (pointer: coarse) {
    .dash-row td { padding-top: 0.6rem; padding-bottom: 0.6rem; }
    .page-link { padding: 0.4rem 0.6rem; }
    .form-select, .form-control { min-height: 2.25rem; }
}

/* ── Dispo/Card View ──────────────────────────────── */
.mitarbeiter-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

.drag-placeholder {
    border: 2px dashed #adb5bd;
    border-radius: var(--radius-sm);
    background: #f8f9fa;
    height: 60px;
    margin-bottom: 0.5rem;
}

/* Responsive Card View */
@media (max-width: 767.98px) {
    .mitarbeiter-cards-container {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Public Landing Page
   ===================================================== */

@keyframes landingReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes landingGlowDrift {
    0%, 100% {
        opacity: 0.42;
        transform: translate3d(-1.5%, -1%, 0);
    }
    50% {
        opacity: 0.62;
        transform: translate3d(1.5%, 1%, 0);
    }
}

@keyframes demoSheen {
    0% {
        transform: translateX(-130%);
    }
    42%, 100% {
        transform: translateX(130%);
    }
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(4, 120, 87, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.1);
    }
}

.login-overlay {
    align-items: stretch;
    justify-content: center;
    background: #0b1120;
    color: #f8fafc;
    padding: 0;
}

.login-overlay a {
    text-decoration: none;
}

.landing-shell {
    position: relative;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    isolation: isolate;
    background: #111827;
}

.landing-shell::before {
    content: "";
    position: fixed;
    inset: -32%;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(118deg, #111827 0%, #381958 29%, #0f766e 61%, #172554 100%);
    background-size: 230% 230%;
    animation: authGradientShift 18s ease-in-out infinite;
}

.landing-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.06) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.18) 0 1px, transparent 1.5px);
    background-size: 84px 84px, 84px 84px, 28px 28px;
    -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,0.18), #000 26%, #000 72%, rgba(0,0,0,0.22));
    mask-image: linear-gradient(135deg, rgba(0,0,0,0.18), #000 26%, #000 72%, rgba(0,0,0,0.22));
    animation: authPatternDrift 24s linear infinite;
}

.landing-shell * {
    letter-spacing: 0;
}

.landing-nav,
.landing-content,
.landing-footer {
    position: relative;
    z-index: 1;
}

.landing-nav {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 4;
    backdrop-filter: blur(14px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: #fff;
    animation: landingReveal 0.6s ease-out 0.05s both;
}

.landing-brand:hover {
    color: #fff;
}

.landing-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.landing-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.landing-brand strong,
.landing-brand small {
    display: block;
    line-height: 1.1;
}

.landing-brand strong {
    font-size: 1rem;
}

.landing-brand small {
    color: #a7b7cf;
    font-size: 0.78rem;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    animation: landingReveal 0.6s ease-out 0.12s both;
}

.landing-nav-actions .btn,
.landing-actions .btn {
    border-radius: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.landing-nav-actions .btn:hover,
.landing-actions .btn:hover {
    transform: translateY(-1px);
}

.landing-content {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    flex: 1 0 auto;
    min-width: 0;
}

.landing-hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 430px);
    align-items: center;
    gap: 2rem;
    padding: 3.6rem 0 3rem;
    min-width: 0;
}

.landing-hero-copy {
    max-width: 720px;
    min-width: 0;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 1.1rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid rgba(125, 211, 252, 0.35);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.12);
    font-size: 0.9rem;
    font-weight: 600;
    animation: landingReveal 0.62s ease-out 0.18s both;
}

.landing-hero h1 {
    margin: 0;
    color: #fff;
    font-size: 4rem;
    line-height: 1.02;
    font-weight: 800;
    overflow-wrap: break-word;
    animation: landingReveal 0.68s cubic-bezier(0.2, 0.72, 0.22, 1) 0.26s both;
}

.landing-hero-copy > p {
    max-width: 650px;
    margin: 1.2rem 0 0;
    color: #cfdae8;
    font-size: 1.15rem;
    line-height: 1.65;
    animation: landingReveal 0.68s cubic-bezier(0.2, 0.72, 0.22, 1) 0.34s both;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.7rem;
    animation: landingReveal 0.68s cubic-bezier(0.2, 0.72, 0.22, 1) 0.42s both;
}

.landing-actions .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.landing-actions .btn-outline-light,
.landing-nav-actions .btn-outline-light {
    --bs-btn-color: #f8fafc;
    --bs-btn-border-color: rgba(248, 250, 252, 0.36);
    --bs-btn-hover-bg: rgba(248, 250, 252, 0.1);
    --bs-btn-hover-border-color: rgba(248, 250, 252, 0.58);
}

.landing-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.45rem;
    animation: landingReveal 0.68s cubic-bezier(0.2, 0.72, 0.22, 1) 0.5s both;
}

.landing-trust span {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: #d7e2f0;
    font-size: 0.92rem;
}

.landing-trust i {
    color: #86efac;
}

.landing-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: -0.6rem 0 2.4rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.16);
    animation: landingReveal 0.68s cubic-bezier(0.2, 0.72, 0.22, 1) 0.56s both;
}

.workflow-item {
    display: flex;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem;
}

.workflow-item + .workflow-item {
    border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.workflow-item > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(134, 239, 172, 0.28);
    border-radius: 8px;
    background: rgba(134, 239, 172, 0.1);
    color: #86efac;
    font-size: 0.78rem;
    font-weight: 800;
}

.workflow-item h2 {
    margin: 0 0 0.25rem;
    color: #fff;
    font-size: 0.98rem;
    line-height: 1.25;
}

.workflow-item p {
    margin: 0;
    color: #bfcbda;
    font-size: 0.88rem;
    line-height: 1.45;
}

.login-panel {
    width: 100%;
    min-width: 0;
    animation: landingReveal 0.72s cubic-bezier(0.2, 0.72, 0.22, 1) 0.34s both;
}

.login-panel .login-container {
    width: 100%;
    max-width: 430px;
    gap: 1rem;
    align-items: stretch;
    margin-left: auto;
}

.login-panel .login-brand {
    color: #fff;
}

.login-panel .brand-title {
    color: #fff;
    letter-spacing: 0;
}

.login-panel .brand-subtitle {
    color: #b6c5d8;
}

.login-panel .login-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.login-panel .login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 28px 82px rgba(0, 0, 0, 0.42);
}

.login-panel .login-copyright p {
    color: #a7b7cf !important;
}

.login-card .input-group-text {
    border-color: #e2e8f0 !important;
}

#demoModeBanner strong {
    font-size: 0.875rem;
}

#demoModeBanner span {
    font-size: 0.8125rem;
}

.landing-demo-section,
.landing-features {
    padding: 2.7rem 0;
}

.landing-section-heading {
    max-width: 760px;
    margin-bottom: 1.4rem;
    animation: landingReveal 0.68s ease-out both;
}

.landing-section-heading span {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: #93c5fd;
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
}

.landing-section-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1.15;
    font-weight: 750;
}

.demo-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 1rem;
    align-items: stretch;
}

.demo-window {
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    background: #f8fafc;
    color: #111827;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    min-width: 0;
    animation: landingReveal 0.68s cubic-bezier(0.2, 0.72, 0.22, 1) both;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.demo-window::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.24) 45%, transparent 62%);
    transform: translateX(-130%);
    animation: demoSheen 7s ease-in-out 1.2s infinite;
}

.demo-window:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 78px rgba(0, 0, 0, 0.34);
}

.demo-window-compact {
    animation-delay: 0.12s;
}

.demo-window-bar {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.demo-window-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.demo-window-bar span:nth-child(2) {
    background: #f59e0b;
}

.demo-window-bar span:nth-child(3) {
    background: #10b981;
}

.demo-window-bar strong {
    margin-left: 0.4rem;
    font-size: 0.86rem;
    color: #475569;
}

.demo-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.9rem;
    background: #eef2f7;
}

.demo-toolbar span {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0 0.7rem;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-table {
    padding: 0.25rem 0.9rem 0.95rem;
}

.demo-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 78px 68px 78px;
    gap: 0.5rem;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid #e5e7eb;
    color: #475569;
    font-size: 0.88rem;
}

.demo-row strong {
    min-width: 0;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-row em {
    width: fit-content;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-style: normal;
    font-size: 0.78rem;
    animation: statusPulse 3.5s ease-in-out infinite;
}

.demo-row em.status-badge {
    background: #475569;
    color: #f1f5f9;
    animation: none;
}

.demo-row b {
    display: inline-block;
    width: fit-content;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.demo-row b.prio-hoch {
    background: #ef4444;
    color: #fff;
}

.demo-row b.prio-mittel {
    background: #f59e0b;
    color: #fff;
}

.demo-row-head {
    min-height: 36px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ai-demo-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.ai-demo-card small {
    color: #7B3FA0;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.ai-demo-card p {
    margin: 0.35rem 0 0;
    color: #1f2937;
    line-height: 1.5;
}

.ai-demo-card ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ai-demo-card li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #475569;
    font-size: 0.9rem;
}

.ai-demo-card li i {
    color: #16a34a;
    font-size: 1rem;
    flex-shrink: 0;
}

.ai-demo-card li i.bi-cpu {
    color: #a78bfa;
}

.ai-demo-card li i.bi-building {
    color: #60a5fa;
}

.ai-demo-card li i.bi-person-check {
    color: #34d399;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.feature-card {
    min-height: 190px;
    padding: 1.4rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    color: #d7e2f0;
    animation: landingReveal 0.62s cubic-bezier(0.2, 0.72, 0.22, 1) both;
    transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(147, 197, 253, 0.35);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 8px 32px rgba(123, 63, 160, 0.18);
}

.feature-card:nth-child(2) {
    animation-delay: 0.08s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.16s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.24s;
}

.feature-card > i {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    border-radius: 50%;
    background: rgba(134, 239, 172, 0.16);
    color: #86efac;
    font-size: 1.3rem;
    box-shadow: 0 0 0 6px rgba(134, 239, 172, 0.07);
}

.feature-card:nth-child(2) > i {
    background: rgba(147, 197, 253, 0.18);
    color: #93c5fd;
    box-shadow: 0 0 0 6px rgba(147, 197, 253, 0.07);
}

.feature-card:nth-child(3) > i {
    background: rgba(216, 180, 254, 0.18);
    color: #d8b4fe;
    box-shadow: 0 0 0 6px rgba(216, 180, 254, 0.07);
}

.feature-card:nth-child(4) > i {
    background: rgba(251, 191, 36, 0.16);
    color: #fbbf24;
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.07);
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.25;
}

.feature-card p {
    margin: 0;
    color: #c7d2e2;
    font-size: 0.94rem;
    line-height: 1.55;
}

/* ── Try / Demo Section ──────────────────────────── */
.landing-download {
    width: min(860px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 5rem 0 4rem;
    text-align: center;
}

.demo-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    margin-top: 2.5rem;
    backdrop-filter: blur(12px);
    text-align: left;
    transition: var(--transition);
}

.demo-cta-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.demo-cta-body {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.demo-cta-icon {
    font-size: 2.5rem;
    color: #4ade80;
    flex-shrink: 0;
    line-height: 1;
}

.demo-cta-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.4rem;
}

.demo-cta-body p {
    color: #c7d2e2;
    font-size: 0.96rem;
    line-height: 1.55;
    margin: 0;
}

.demo-cta-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 600;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-md);
}

.self-hosted-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.self-hosted-title {
    color: #8fa1b8;
    font-size: 0.9rem;
    margin: 0;
}

.self-hosted-desc {
    color: #7a8fa5;
    font-size: 0.875rem;
    margin: 0;
}

/* ── Pricing Section ─────────────────────────────── */
.landing-pricing {
    width: min(900px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 5rem 0 4rem;
    text-align: center;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem 2rem;
    text-align: left;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
}

.pricing-card:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-3px);
}

.pricing-card.featured {
    background: rgba(123, 63, 160, 0.22);
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2), 0 8px 32px rgba(123, 63, 160, 0.25);
}

.pricing-card.featured:hover {
    background: rgba(123, 63, 160, 0.28);
}

.pricing-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #7b3fa0, #a855f7);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pricing-icon {
    font-size: 2rem;
    color: #a78bfa;
    line-height: 1;
}

.pricing-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.pricing-tagline {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0.25rem 0;
}

.pricing-amount {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.pricing-period {
    color: #94a3b8;
    font-size: 0.9rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #c7d2e2;
    font-size: 0.92rem;
}

.pricing-features li i {
    color: #4ade80;
    font-size: 1rem;
    flex-shrink: 0;
}

.pricing-feature-optional {
    color: #8fa1b8 !important;
    font-style: italic;
}

.pricing-feature-optional i {
    color: #64748b !important;
}

.pricing-btn {
    width: 100%;
    text-align: center;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    margin-top: auto;
}

.pricing-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #8fa1b8;
    font-size: 0.875rem;
    line-height: 1.6;
}

.pricing-footer p {
    margin: 0 0 0.4rem;
}

.pricing-contact-link {
    color: #a78bfa;
    text-decoration: none;
}

.pricing-contact-link:hover {
    text-decoration: underline;
}

.pricing-vat {
    color: #64748b !important;
    font-size: 0.8rem !important;
}

.pricing-conditions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.75rem !important;
}

.pricing-conditions .divider {
    color: rgba(255, 255, 255, 0.2);
}

.pricing-partner {
    font-size: 0.9rem;
    color: #e2e8f0;
    margin: 0 !important;
}

.landing-footer {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.4rem 0 1.8rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #8fa1b8;
    font-size: 0.86rem;
}

@media (max-width: 991.98px) {
    .landing-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 2.4rem 0 2rem;
    }

    .landing-hero h1 {
        font-size: 3rem;
    }

    .login-panel .login-container {
        max-width: 560px;
        margin: 0;
    }

    .landing-workflow {
        grid-template-columns: 1fr;
        margin: 0 0 2rem;
    }

    .workflow-item + .workflow-item {
        border-left: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.18);
    }

    /* Improved mobile navigation */
    .landing-nav {
        padding: 1rem 1.5rem;
    }

    .landing-nav-actions {
        gap: 0.75rem;
    }

    .landing-nav-actions .btn {
        min-height: 44px; /* Touch-friendly size */
        padding: 0.75rem 1rem;
    }

    .demo-showcase {
        grid-template-columns: 1fr;
    }

    .landing-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    html,
    body {
        overflow-x: hidden;
    }

    .login-overlay {
        padding: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .landing-shell {
        width: 100vw;
        max-width: 100vw;
        background: #111827;
    }

    .landing-nav,
    .landing-content,
    .landing-footer {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    /* Mobile-specific improvements */
    .landing-nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .landing-brand {
        justify-content: center;
    }

    .landing-nav-actions {
        justify-content: center;
        width: 100%;
    }

    .landing-nav-actions .btn {
        flex: 1;
        min-height: 48px;
        font-size: 1rem;
    }

    .landing-hero {
        padding: 2rem 0;
    }

    .landing-hero h1 {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

    .landing-hero-copy > p {
        font-size: 1.1rem;
        line-height: 1.6;
        margin-bottom: 2rem;
    }

    .landing-actions {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .landing-actions .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1.1rem;
    }

    .landing-trust {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-top: 2rem;
    }

    .landing-trust span {
        font-size: 0.9rem;
        flex: 1;
        min-width: calc(50% - 0.375rem);
        text-align: center;
    }

    .landing-nav {
        flex-direction: column;
        align-items: stretch;
        position: relative;
        backdrop-filter: none;
    }

    .landing-nav-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        align-items: stretch;
        gap: 0.4rem;
    }

    .landing-nav-actions .btn {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
        font-size: 0.8rem;
        min-width: 0;
        width: 100%;
    }

    .landing-hero {
        gap: 1.4rem;
        padding: 1.4rem 0 1.6rem;
    }

    .landing-kicker {
        font-size: 0.78rem;
        line-height: 1.35;
        white-space: normal;
    }

    .landing-hero h1 {
        max-width: 100%;
        font-size: 1.78rem;
        line-height: 1.08;
    }

    .landing-hero-copy > p {
        max-width: 100%;
        font-size: 1rem;
        line-height: 1.55;
        overflow-wrap: break-word;
    }

    .landing-actions {
        flex-direction: column;
    }

    .landing-actions .btn {
        width: 100%;
    }

    .landing-trust {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .landing-trust span {
        min-width: 0;
    }

    .landing-workflow {
        margin-top: 0.4rem;
    }

    .workflow-item {
        padding: 0.9rem;
    }

    .login-panel,
    .login-panel .login-container,
    .login-panel .login-card,
    .demo-window,
    .feature-card {
        max-width: 100%;
    }

    .login-panel .login-container {
        max-width: none;
        gap: 0.85rem;
    }

    .login-panel .login-card {
        padding: 1.2rem;
    }

    .demo-toolbar,
    .demo-row {
        grid-template-columns: 1fr;
    }

    .demo-toolbar span,
    .demo-row {
        min-height: 34px;
    }

    .demo-row {
        gap: 0.2rem;
        padding: 0.75rem 0;
    }

    .demo-row-head {
        display: none;
    }

    .landing-section-heading h2 {
        font-size: 1.55rem;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }

    .feature-card {
        min-height: auto;
    }

    .landing-pricing {
        padding: 3rem 0 2rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .landing-download {
        padding: 3rem 0 2rem;
    }

    .demo-cta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .demo-cta-btn {
        width: 100%;
        text-align: center;
    }

    .self-hosted-section {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .download-card {
        min-width: auto;
        max-width: 320px;
        margin: 0 auto;
    }

    .landing-footer {
        flex-direction: column;
        padding-bottom: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-shell::before,
    .landing-brand,
    .landing-nav-actions,
    .landing-kicker,
    .landing-hero h1,
    .landing-hero-copy > p,
    .landing-actions,
    .landing-trust,
    .login-panel,
    .landing-section-heading,
    .landing-workflow,
    .demo-window,
    .demo-window::after,
    .demo-row em,
    .feature-card {
        animation: none !important;
    }

    .login-panel .login-card,
    .demo-window,
    .feature-card,
    .download-card {
        transition: none !important;
    }

    .login-panel .login-card:hover,
    .demo-window:hover,
    .feature-card:hover,
    .download-card:hover {
        transform: none;
    }
}
