/* ==========================================================================
   Elisabeth Atlas – Ergänzungen zum Elisabeth-Stil
   ========================================================================== */

:root {
    --atlas-lane-bg: #f8fafc;
    --atlas-lane-head: #eef3f8;
    --atlas-lane-border: #d9e2ec;
    --atlas-task-bg: #ffffff;
    --atlas-task-border: #0080c1;
    --atlas-call-bg: #f3efff;
    --atlas-call-border: #7c4dce;
    --atlas-text: #1f2937;
    --atlas-muted: #6b7280;
    --atlas-edge: #64748b;
    --atlas-break: #f76707;
    --atlas-mine-bg: #e6f4fb;
    --atlas-gw-bg: #fff8e6;
    --atlas-gw-border: #c58b00;
}

[data-bs-theme=dark] {
    --atlas-lane-bg: #18202b;
    --atlas-lane-head: #1f2a37;
    --atlas-lane-border: #2c3b4f;
    --atlas-task-bg: #1d2735;
    --atlas-task-border: #3aa7dc;
    --atlas-call-bg: #261f3a;
    --atlas-call-border: #a98ce8;
    --atlas-text: #e5e7eb;
    --atlas-muted: #9aa4b2;
    --atlas-edge: #8a96a8;
    --atlas-break: #ff922b;
    --atlas-mine-bg: #0f3247;
    --atlas-gw-bg: #2e2716;
    --atlas-gw-border: #e0a92c;
}

/* --- Diagramm (SVG) --- */
.atlas-diagram-wrap {
    overflow: auto;
    max-height: 78vh;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface);
    position: relative;
}
.atlas-diagram-wrap.is-fullscreen { max-height: none; height: 100vh; }
.atlas-diagram { display: block; font-family: Lato, var(--tblr-font-sans-serif), sans-serif; transform-origin: 0 0; }
.atlas-diagram .dg-lane { fill: var(--atlas-lane-bg); stroke: var(--atlas-lane-border); stroke-width: 1; }
.atlas-diagram .dg-pool { fill: none; stroke: var(--atlas-lane-border); stroke-width: 1.5; }
.atlas-diagram .dg-lane-head { fill: var(--atlas-lane-head); stroke: var(--atlas-lane-border); stroke-width: 1; }
.atlas-diagram .dg-lane-label { fill: var(--atlas-text); font-size: 13px; font-weight: 700; }
.atlas-diagram .dg-lane-hl .dg-lane { fill: var(--atlas-mine-bg); }
.atlas-diagram .dg-task { fill: var(--atlas-task-bg); stroke: var(--atlas-task-border); stroke-width: 1.6; }
.atlas-diagram .dg-task.dg-call { fill: var(--atlas-call-bg); stroke: var(--atlas-call-border); stroke-width: 2.6; }
.atlas-diagram .dg-task.dg-task-mine { stroke-width: 3; fill: var(--atlas-mine-bg); }
.atlas-diagram .dg-label { fill: var(--atlas-text); font-size: 12px; }
.atlas-diagram .dg-label-small { font-size: 11px; fill: var(--atlas-muted); }
.atlas-diagram .dg-tools { fill: var(--atlas-muted); font-size: 10px; }
.atlas-diagram .dg-cond { fill: var(--atlas-muted); font-size: 11px; font-style: italic; paint-order: stroke; stroke: var(--atlas-lane-bg); stroke-width: 3px; }
.atlas-diagram .dg-event { fill: var(--atlas-task-bg); stroke: #2fb344; stroke-width: 2; }
.atlas-diagram .dg-event-end { stroke: #d63939; stroke-width: 4; }
.atlas-diagram .dg-event-mid { stroke: var(--atlas-edge); stroke-width: 1.5; fill: var(--atlas-task-bg); }
.atlas-diagram .dg-event-throw { fill: var(--atlas-lane-head); }
.atlas-diagram .dg-gateway { fill: var(--atlas-gw-bg); stroke: var(--atlas-gw-border); stroke-width: 1.8; }
.atlas-diagram .dg-marker { fill: var(--atlas-task-bg); stroke: var(--atlas-call-border); stroke-width: 1.2; }
.atlas-diagram .dg-marker-line { stroke: var(--atlas-text); stroke-width: 1.4; fill: none; }
.atlas-diagram .dg-marker-bold { stroke-width: 2.6; stroke: var(--atlas-gw-border); }
.atlas-diagram .dg-datastore { fill: var(--atlas-task-bg); stroke: var(--atlas-edge); stroke-width: 1.4; }
.atlas-diagram .dg-annotation { fill: none; stroke: var(--atlas-edge); stroke-width: 1.2; }
.atlas-diagram .dg-edge { fill: none; stroke: var(--atlas-edge); stroke-width: 1.5; }
.atlas-diagram .dg-edge-back { stroke-dasharray: 6 4; }
.atlas-diagram .dg-edge-assoc { stroke-dasharray: 2 4; }
.atlas-diagram .dg-edge-msg { stroke-dasharray: 8 5; }
.atlas-diagram .dg-edge-break { stroke: var(--atlas-break); stroke-width: 3; }
.atlas-diagram .dg-arrowhead { fill: var(--atlas-edge); }
.atlas-diagram .dg-arrowhead-hl { fill: var(--atlas-break); }
.atlas-diagram .dg-arrowhead-open { fill: none; stroke: var(--atlas-edge); stroke-width: 1.4; }
.atlas-diagram .dg-badge { fill: #0080c1; stroke: var(--atlas-task-bg); stroke-width: 2; }
.atlas-diagram .dg-badge-text { fill: #fff; font-size: 10px; font-weight: 700; }
.atlas-diagram .dg-dim { opacity: .28; }
.atlas-diagram .dg-dim-lane .dg-lane-label { opacity: .5; }
.atlas-diagram a.dg-link { cursor: pointer; }
.atlas-diagram a.dg-link:hover .dg-task { stroke-width: 3; }

.atlas-diagram-toolbar {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 3;
    display: flex;
    gap: .25rem;
    padding: .4rem;
    background: color-mix(in srgb, var(--tblr-bg-surface) 88%, transparent);
    border-bottom: 1px solid var(--tblr-border-color);
}

/* --- Schrittliste / „Was muss ich tun“ --- */
.atlas-step {
    display: flex;
    gap: .9rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--tblr-border-color);
    scroll-margin-top: 1rem;
}
.atlas-step:last-child { border-bottom: 0; }
.atlas-step:target { background: var(--atlas-mine-bg); }
.atlas-step-num {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--tblr-primary-lt, #e6f2f9);
    color: var(--tblr-primary, #0080c1);
}
.atlas-step-num.is-decision { border-radius: 4px; transform: rotate(45deg) scale(.82); }
.atlas-step-num.is-decision > span { transform: rotate(-45deg); }
.atlas-step-num.is-call { background: #f3efff; color: #7c4dce; }
.atlas-step.is-other { opacity: .62; }
.atlas-step-sub { margin-left: 2.9rem; border-left: 3px solid #a98ce8; padding-left: .8rem; }
.atlas-step .atlas-step-title { font-weight: 600; }
.atlas-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    color: var(--tblr-secondary);
    border: 1px solid var(--tblr-border-color);
    white-space: nowrap;
    max-width: 100%;
}
/* Lange Namen (z. B. Qualifikationen) umbrechen statt über den Kartenrand zu laufen */
.card .atlas-chip { white-space: normal; text-align: left; line-height: 1.3; }
.atlas-chip.is-custom { background: #fff4e6; color: #d9480f; border-color: #ffd8a8; }
[data-bs-theme=dark] .atlas-chip.is-custom { background: #3a2410; color: #ffa94d; border-color: #5c3a14; }
.atlas-hint {
    border-left: 3px solid #f59f00;
    background: #fff9db;
    padding: .4rem .7rem;
    border-radius: 0 6px 6px 0;
    font-size: .85rem;
}
[data-bs-theme=dark] .atlas-hint { background: #2b2610; }
.atlas-source {
    font-size: .8rem;
    border-left: 3px solid var(--tblr-azure, #4299e1);
    padding: .25rem .6rem;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface-secondary);
}

/* --- Landkarte --- */
.atlas-map-unit { border-left: 4px solid var(--tblr-primary); }
.atlas-map-unit.depth-1 { border-left-color: #4dabf7; }
.atlas-map-unit.depth-2 { border-left-color: #a5d8ff; }
.atlas-process-tile {
    display: block;
    padding: .55rem .75rem;
    border-radius: 8px;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    color: inherit;
    text-decoration: none;
    height: 100%;
    transition: box-shadow .15s ease, transform .15s ease;
}
.atlas-process-tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); color: inherit; text-decoration: none; }

/* --- Kennzahlen --- */
.atlas-spark { width: 100%; height: 42px; }
.atlas-spark path.line { fill: none; stroke: var(--tblr-primary); stroke-width: 2; }
.atlas-spark path.area { fill: color-mix(in srgb, var(--tblr-primary) 14%, transparent); stroke: none; }
.atlas-bars rect { fill: var(--tblr-primary); }
.atlas-bars text { fill: var(--tblr-secondary); font-size: 10px; }

/* --- Interview --- */
.atlas-question {
    font-size: 1.35rem;
    line-height: 1.4;
    min-height: 4.5rem;
}
.atlas-transcript-seg { display: flex; gap: .75rem; padding: .35rem .25rem; border-radius: 6px; }
.atlas-transcript-seg:target, .atlas-transcript-seg.is-hl { background: var(--atlas-mine-bg); }
.atlas-transcript-seg .time { flex: 0 0 3.5rem; color: var(--tblr-secondary); font-variant-numeric: tabular-nums; font-size: .8rem; padding-top: .1rem; }
.animate-pulse { animation: atlas-pulse 1.4s ease-in-out infinite; }
@keyframes atlas-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* --- Kanban (Vorhaben) --- */
.atlas-kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 1rem; overflow-x: auto; }
.atlas-kanban-col { background: var(--tblr-bg-surface-secondary); border-radius: 10px; padding: .6rem; min-height: 200px; }

/* --- Login --- */
.atlas-login-person {
    cursor: pointer;
    text-align: left;
    width: 100%;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    border-radius: 10px;
    padding: .8rem 1rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.atlas-login-person:hover { border-color: var(--tblr-primary); box-shadow: 0 2px 10px rgba(0,128,193,.15); }

.atlas-demo-banner { border-left-width: 4px; }
.text-pre-line { white-space: pre-line; }
.min-w-0 { min-width: 0; }

@media print {
    .navbar-vertical, .atlas-diagram-toolbar, .atlas-demo-banner, .toast-container { display: none !important; }
    .page-wrapper { margin: 0 !important; }
    .atlas-diagram-wrap { max-height: none; overflow: visible; border: 0; }
    .card { break-inside: avoid; }
}

/* Schrift wie Elisabeth (Lato) – mit sinnvollen Ausweichschriften, falls Lato nicht installiert ist */
body {
    font-family: Lato, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Beschriftungen über Linien lesbar halten */
.atlas-diagram .dg-tools,
.atlas-diagram .dg-label-small { paint-order: stroke; stroke: var(--atlas-lane-bg); stroke-width: 4px; stroke-linejoin: round; }

/* Badges in der Sidebar inline (nicht über den Rand) */
.navbar.navbar-vertical .navbar-nav .nav-link .badge { position: static; margin-left: auto; transform: none; }
