/* DTGX Editor - Dark Theme Stylesheet */

:root {
    --primary: #FF3A00;
    --primary-color: #FF3A00;
    --primary-hover: #FF5722;
    --bg-dark: #0A0A0A;
    --bg-main: #0A0A0A;
    --bg-panel: #141414;
    --bg-elevated: #1A1A1A;
    --bg-sidebar: #0F0F0F;
    --bg-card: #141414;
    --text-light: #FFFFFF;
    --text-primary: #FFFFFF;
    --text-gray: #888888;
    --text-secondary: #888888;
    --text-dark: #666666;
    --warning: #FACC15;
    --success: #22C55E;
    --border-color: #2A2A2A;
    --card-bg: #141414;

    /* ===== 2026 Tokens (Spacing / Radius / Shadow / Motion) ===== */
    /* surfaces */
    --surface-0: #0A0A0A;   /* app bg */
    --surface-1: #0F0F0F;   /* sidebar / inset */
    --surface-2: #141414;   /* panels / cards */
    --surface-3: #1A1A1A;   /* elevated */
    --surface-4: #202020;   /* hover */

    /* borders */
    --border-1: rgba(255,255,255,0.06);
    --border-2: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.14);

    /* typography */
    --text-1: rgba(255,255,255,0.92);
    --text-2: rgba(255,255,255,0.70);
    --text-3: rgba(255,255,255,0.52);

    /* radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;

    /* shadow (keep subtle for performance) */
    --shadow-sm: 0 1px 0 rgba(255,255,255,0.04), 0 10px 24px rgba(0,0,0,0.35);
    --shadow-md: 0 1px 0 rgba(255,255,255,0.05), 0 16px 40px rgba(0,0,0,0.45);
    --shadow-lg: 0 1px 0 rgba(255,255,255,0.06), 0 24px 64px rgba(0,0,0,0.55);

    /* accent glow */
    --accent-glow: 0 0 0 1px rgba(255,58,0,0.22), 0 16px 48px rgba(255,58,0,0.18);

    /* motion */
    --dur-1: 120ms;
    --dur-2: 180ms;
    --dur-3: 260ms;
    --dur-4: 420ms;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in: cubic-bezier(0.32, 0, 0.67, 0);
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: var(--bg-main);
    color: var(--text-light);
    color-scheme: dark;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Better selection */
::selection {
    background: rgba(255, 58, 0, 0.35);
    color: #fff;
}

/* A11y: visible focus ring only when needed */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid rgba(255, 58, 0, 0.55);
    outline-offset: 2px;
}

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

/* Page enter (used by /js/motion.js) */
body[data-page-enter="1"] {
    animation: pageIn var(--dur-4) var(--ease-out) both;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reveal primitives */
[data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
    will-change: opacity, transform;
}
[data-reveal].reveal-in {
    opacity: 1;
    transform: translateY(0);
}

/* Toasts (used by utils.js) */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: min(420px, calc(100vw - 36px));
    background: rgba(20,20,20,0.92);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transform: translateY(-8px);
    opacity: 0;
    transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out);
}
.toast.is-open {
    transform: translateY(0);
    opacity: 1;
}
.toast-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-body { min-width: 0; flex: 1; }
.toast-title {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-1);
    margin: 0 0 2px;
}
.toast-message {
    font-size: 13px;
    color: var(--text-2);
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}
.toast-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}
.toast-close:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }

.toast--success .toast-icon { background: rgba(34,197,94,0.18); color: #22C55E; }
.toast--error .toast-icon { background: rgba(239,68,68,0.16); color: #EF4444; }
.toast--info .toast-icon { background: rgba(59,130,246,0.16); color: #3B82F6; }

.app-container {
    display: flex;
    min-height: 100vh;
}
.app-container.dashboard-hub-no-sidebar {
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset;
    background-image:
        radial-gradient(900px 420px at -20% -10%, rgba(255,58,0,0.14), transparent 60%),
        radial-gradient(600px 360px at 120% 0%, rgba(59,130,246,0.10), transparent 55%);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
}
.sidebar-header-support {
    display: block;
    margin-top: 10px;
    font-size: 10px;
    color: var(--primary-color);
    text-decoration: underline;
    border: 1px solid rgba(0, 0, 0, 1);
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}
.sidebar-header-support:hover { color: var(--primary-hover); }
.dashboard-hero-support {
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    color: var(--primary-color);
    text-decoration: underline;
}
.dashboard-hero-support:hover { color: var(--primary-hover); }

.logo-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset, 0 12px 28px rgba(255,58,0,0.18);
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text-main {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-light);
    line-height: 1;
}

.logo-text-sub {
    font-size: 10px;
    color: var(--text-gray);
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
}

.logo-text {
    font-size: 11px;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.16) transparent;
}
/* WebKit scrollbar (Chromium/Edge) */
.sidebar-nav::-webkit-scrollbar { width: 10px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.10);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); border: 3px solid transparent; background-clip: content-box; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
    border-left: 3px solid transparent;
    margin: 2px 0;
    border-radius: 12px;
    margin: 4px 10px;
    padding: 11px 12px;
    border-left: none;
}

.nav-item:hover:not(.active) {
    background: rgba(255,255,255,0.04);
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(255,58,0,0.14);
    color: var(--primary-color);
    position: relative;
    box-shadow: var(--accent-glow);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.9;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: 0.95;
}

/* Ordner/Kategorien Navigation */
.nav-folder-section {
    margin: 8px 0;
    padding: 0 8px;
}

.nav-folder-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-gray);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}

.nav-folder-header:hover {
    background: rgba(255,255,255,0.04);
}

.nav-folder-toggle {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0.7;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-folder-toggle:hover {
    opacity: 1;
    background: var(--bg-panel);
    color: var(--text-light);
}

.nav-folder-section.collapsed .nav-folder-toggle i {
    transform: rotate(-90deg);
}

/* Collapse animation (replaces display:none) */
.nav-folder-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height var(--dur-4) var(--ease-out), opacity var(--dur-3) var(--ease-out);
}
.nav-folder-section:not(.collapsed) .nav-folder-list {
    max-height: 520px;
    opacity: 1;
}

.nav-folder-add {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-folder-add:hover {
    opacity: 1;
    background: var(--bg-panel);
    color: var(--primary-color);
}

.nav-folder-list {
    margin-top: 4px;
}

.nav-folder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 32px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 2px 0;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    position: relative;
}

.nav-folder-item:hover {
    background: var(--bg-panel);
}

.nav-folder-item.active {
    background: rgba(255, 58, 0, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-folder-item::before {
    content: '';
    position: absolute;
    left: 12px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.6;
}

.nav-folder-item.active::before {
    opacity: 1;
    background: var(--primary-color);
}

.nav-folder-item-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-gray);
    background: var(--bg-panel);
    padding: 2px 6px;
    border-radius: 10px;
}

.nav-folder-item.active .nav-folder-item-count {
    background: rgba(255, 58, 0, 0.2);
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    background: rgba(255, 58, 0, 0.1);
    margin: 10px;
    border-radius: 6px;
    text-align: center;
}

.sidebar-footer div:first-child {
    color: var(--text-gray);
    margin-bottom: 4px;
    font-size: 11px;
}

.sidebar-footer div:last-child {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 11px;
    text-decoration: underline;
}

/* Main Content – scrollt eigenständig, Sidebar bleibt fix */
.main-content {
    flex: 1;
    padding: 30px 40px;
    min-height: 100vh;
    margin-left: 220px;
    width: calc(100% - 220px);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-panel);
}

.main-content > * {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.main-content .preview-container {
    max-width: none;
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    width: 100%;
    max-width: 1400px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-light);
}

.subtitle {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), filter var(--dur-2) var(--ease-out);
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: 0 0 0 2px rgba(255,58,0,0.35); }

.btn i {
    font-size: 14px;
}

a.btn {
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(255,58,0,1) 0%, rgba(255,92,26,1) 100%);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-panel);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.btn-secondary.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
}

/* Stats Grid – React-Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 1400px;
}

.stat-card {
    background: #141414;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #1F1F1F;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}

.stat-card:hover {
    border-color: rgba(255,255,255,0.10);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-body { flex: 1; min-width: 0; }
.stat-body .stat-label { color: #666; font-size: 14px; margin: 0 0 4px 0; }
.stat-body .stat-value { font-size: 28px; font-weight: 700; color: var(--text-light); margin: 0; }

.stat-icon-wrap {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon-wrap i { font-size: 24px; }
.stat-icon-orange { background: rgba(255, 58, 0, 0.15); color: #FF3A00; }
.stat-icon-amber  { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.stat-icon-green  { background: rgba(16, 185, 129, 0.15); color: #10B981; }

/* Filters */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 1400px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-gray);
    font-size: 14px;
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 12px 16px 12px 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,58,0,0.18);
}

.filter-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-select-wrapper .filter-icon {
    position: absolute;
    left: 16px;
    color: var(--text-gray);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.filter-select {
    padding: 12px 16px 12px 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A0A0A0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    appearance: none;
}
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,58,0,0.18);
}

/* Instructions Grid – React-Style */
.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 1400px;
}

@media (min-width: 1200px) {
    .instructions-grid { grid-template-columns: repeat(3, 1fr); }
}

.instruction-card {
    background: #141414;
    border: 1px solid #1F1F1F;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.instruction-card--with-thumb:hover {
    border-color: rgba(255, 58, 0, 0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.instruction-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Thumbnail + Hover-Overlay (React-Style) */
.card-thumbnail {
    height: 160px;
    background: #0F0F0F;
    position: relative;
    overflow: hidden;
}

.card-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2A2A2A;
}
.card-thumbnail-placeholder i { font-size: 48px; }

.card-thumbnail-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #141414, transparent);
    pointer-events: none;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}
.instruction-card--with-thumb:hover .card-overlay { opacity: 1; }

.btn-overlay {
    padding: 8px 12px;
    font-size: 13px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-overlay:hover { background: rgba(255,255,255,0.2); }

.instruction-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.instruction-card-text { flex: 1; min-width: 0; }
.instruction-card-menu { flex-shrink: 0; }

.card-menu-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 16px;
}
.card-menu-btn:hover { color: #fff; background: #1A1A1A; }

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle { color: #666; font-size: 14px; line-height: 1.4; margin: 0; }
.card-subtitle--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.instruction-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.card-status i { font-size: 11px; }
.card-status--outline { background: transparent; }

.card-meta {
    font-size: 12px;
    color: #666;
}

/* Dropdown (Duplizieren / Löschen) */
.card-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-dropdown-item:hover { background: #2A2A2A; }
.card-dropdown-item--danger { color: #EF4444; }
.card-dropdown-item--danger:hover { background: rgba(239,68,68,0.1); }

/* Empty State – React-Style */
.dashboard-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
}
.dashboard-empty-icon {
    width: 80px; height: 80px;
    border-radius: 16px;
    background: #141414;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #444;
}
.dashboard-empty-icon i { font-size: 40px; }
.dashboard-empty-title { font-size: 20px; font-weight: 600; margin: 0 0 8px; color: var(--text-light); }
.dashboard-empty-text { color: #666; margin: 0 0 24px; }

/* ========== Home – animiertes Dashboard mit Vorschau-Fenstern ========== */
.home-main { padding: 32px 28px; max-width: 1400px; margin: 0 auto; }
.home-hero {
    text-align: center;
    margin-bottom: 48px;
    animation: homeFadeIn 0.6s ease-out;
}
@keyframes homeFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.home-hero-title { font-size: 2rem; font-weight: 700; margin: 0 0 10px; color: var(--text-light); letter-spacing: -0.5px; }
.home-hero-sub { font-size: 1rem; color: var(--text-secondary); margin: 0; }

.preview-windows-heading { font-size: 1.1rem; font-weight: 600; color: var(--text-gray); margin: 0 0 20px; }
.preview-windows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.preview-window {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.preview-window:hover {
    border-color: rgba(255,58,0,0.4);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    transform: translateY(-2px);
}
.preview-window--wide { grid-column: span 1; }
@media (min-width: 900px) { .preview-window--wide { grid-column: span 2; } }

.preview-window--animate { opacity: 0; animation: previewCardIn 0.5s ease-out forwards; }
.preview-window--animate[data-delay="0"] { animation-delay: 0.1s; }
.preview-window--animate[data-delay="1"] { animation-delay: 0.2s; }
.preview-window--animate[data-delay="2"] { animation-delay: 0.35s; }
.preview-window--animate[data-delay="3"] { animation-delay: 0.5s; }
@keyframes previewCardIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-window-pane {
    height: 140px;
    background: #0F0F0F;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.preview-window-pane--split { height: 160px; }
.preview-window-mock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 200px;
}
.preview-window-mock-bar { height: 8px; background: #2A2A2A; border-radius: 4px; width: 70%; }
.preview-window-mock-card { height: 24px; background: #1A1A1A; border-radius: 4px; width: 100%; }
.preview-window-mock-tile { height: 28px; background: #1A1A1A; border-radius: 4px; width: 48%; display: inline-block; margin: 2%; }
.preview-window-mock-line { height: 10px; background: #1A1A1A; border-radius: 4px; width: 90%; }
.preview-window-mock--editor {
    flex-direction: row;
    max-width: 100%;
    gap: 12px;
}
.preview-window-mock-editor { flex: 1; min-height: 60px; background: #1A1A1A; border-radius: 8px; }
.preview-window-mock-preview { flex: 1; min-height: 60px; background: #1A1A1A; border-radius: 8px; border: 1px dashed #333; }

.preview-window-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.preview-window-icon {
    width: 44px; height: 44px; border-radius: 10px; background: rgba(255,58,0,0.12);
    display: flex; align-items: center; justify-content: center; color: var(--primary-color);
    font-size: 18px; margin-bottom: 12px;
}
.preview-window-icon--primary { background: rgba(255,58,0,0.2); }
.preview-window-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 6px; color: var(--text-light); }
.preview-window-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; }
.preview-window-meta { font-size: 12px; color: var(--text-gray); margin-bottom: 12px; }
.preview-window-cta { font-size: 13px; font-weight: 500; color: var(--primary-color); display: inline-flex; align-items: center; gap: 6px; margin-top: auto; }
.preview-window:hover .preview-window-cta { text-decoration: underline; }

/* Dashboard-Hub: eigenständige Seite nur mit Seiten-Karten (Seitenname + Vorschaubild) */
.dashboard-hub-no-sidebar { 
    flex-direction: column;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
}
.dashboard-hub-no-sidebar .main-content {
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: auto !important;
    max-width: 1200px !important;
    flex: 0 1 auto !important;
    position: relative !important;
    z-index: 1;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    min-height: auto;
    height: auto !important;
    overflow: visible !important;
    left: auto !important;
    right: auto !important;
    align-self: flex-start;
}
.dashboard-hub-no-sidebar .main-content > * {
    max-width: 1200px !important;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}
.dashboard-hub-footer {
    flex-shrink: 0;
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    background: rgba(255, 58, 0, 0.1);
    margin: 0 auto;
    margin-top: auto;
    max-width: 320px;
    border-radius: 6px;
    text-align: center;
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    position: relative;
    bottom: 0;
}
.dashboard-hub-footer div:first-child {
    color: var(--text-gray);
    margin-bottom: 4px;
    font-size: 11px;
}
.dashboard-hub-footer div:last-child {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 11px;
    text-decoration: underline;
}
.dashboard-hub-main { 
    padding: 32px 28px; 
    max-width: 1200px; 
    width: 100%;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: flex-start;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}
main.dashboard-hub-main {
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    left: auto !important;
    right: auto !important;
    position: relative !important;
}
.dashboard-hub-hero { 
    text-align: center; 
    margin-bottom: 40px;
    margin-top: 0;
    width: 100%;
    align-self: flex-start;
    height: 200px;
    padding-top: 50px;
    padding-bottom: 50px;
    box-sizing: border-box;
}
.dashboard-hub-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 8px; color: var(--text-light); }
.dashboard-hub-sub { font-size: 1rem; color: var(--text-secondary); margin: 0; }

.dashboard-page-cards {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.dashboard-page-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: 24px;
    text-align: left;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
.dashboard-page-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.dashboard-page-card:hover {
    border-color: rgba(255,92,26,0.5);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    transform: translateY(-2px);
}
.dashboard-page-card-preview {
    height: 180px;
    background: #0B0B0B;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
}
.dashboard-page-card--snapshot .dashboard-page-card-preview {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}
.dashboard-page-card-snapshot-wrap {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}
.dashboard-page-card-snapshot-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.dashboard-page-card-snapshot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1280px;
    height: 720px;
    margin-top: -360px;
    margin-left: -640px;
    border: none;
    transform: scale(0.32) translateX(75px);
    transform-origin: center center;
    pointer-events: none;
}
/* 1280×720 auf ~282×158 skaliert: ganze /instructions-Seite „rausgezoomt" im gleichen Rahmen */
.dashboard-page-card-border {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
}
.dashboard-page-mock {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 220px;
}
.dashboard-page-mock-bar { height: 10px; background: #2A2A2A; border-radius: 4px; width: 75%; }
.dashboard-page-mock--instructions .dashboard-page-mock-bar { background: rgba(255,92,26,0.6); }
.dashboard-page-mock-card {
    height: 28px;
    background: #1A1A1A;
    border-radius: 6px;
    width: 100%;
    border: 1px solid #252525;
}
.dashboard-page-mock--screenshot { max-width: 100%; gap: 8px; }
.dashboard-page-mock--screenshot .dashboard-page-mock-header {
    height: 10px;
    width: 100%;
    background: rgba(255, 92, 26, 0.7);
    border-radius: 2px;
    flex-shrink: 0;
    display: block;
}
.dashboard-page-mock--screenshot .dashboard-page-mock-stats {
    display: flex;
    gap: 6px;
}
.dashboard-page-mock--screenshot .dashboard-page-mock-stats span {
    flex: 1;
    height: 22px;
    background: #1A1A1A;
    border-radius: 4px;
}
.dashboard-page-mock--screenshot .dashboard-page-mock-search {
    height: 8px;
    background: #2A2A2A;
    border-radius: 4px;
    width: 72%;
    flex-shrink: 0;
    display: block;
}
.dashboard-page-mock--screenshot .dashboard-page-mock-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
}
.dashboard-page-mock--screenshot .dashboard-page-mock-instruction {
    display: flex;
    gap: 8px;
    align-items: center;
}
.dashboard-page-mock--screenshot .mock-thumb {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: #1A1A1A;
    border-radius: 4px;
}
.dashboard-page-mock--screenshot .mock-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.dashboard-page-mock--screenshot .mock-lines span {
    height: 6px;
    background: #252525;
    border-radius: 2px;
}
.dashboard-page-mock--screenshot .mock-lines span:first-child { width: 88%; }
.dashboard-page-mock--screenshot .mock-lines span:last-child { width: 55%; }
.dashboard-page-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.dashboard-page-card-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 6px; color: var(--text-light); }
.dashboard-page-card-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; }
.dashboard-page-card-meta { font-size: 12px; color: var(--text-gray); margin-bottom: 12px; }
.dashboard-page-card-cta { font-size: 13px; font-weight: 500; color: var(--primary-color); display: inline-flex; align-items: center; gap: 6px; margin-top: auto; }
.dashboard-page-card:hover .dashboard-page-card-cta { text-decoration: underline; }

.dashboard-page-card--animate { opacity: 0; animation: previewCardIn 0.5s ease-out forwards; }
.dashboard-page-card--animate[data-delay="0"] { animation-delay: 0.1s; }

/* ========== Editor & Vorschau – Split-View ========== */
.editor-preview-body { overflow: hidden; }
.editor-preview-container { height: 100vh; }
.editor-preview-main { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; }
.editor-preview-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-panel); flex-shrink: 0;
}
.editor-preview-tabs { display: flex; gap: 4px; }
.editor-preview-tab {
    padding: 6px 14px; border-radius: 6px; font-size: 13px; color: var(--text-gray);
    display: inline-flex; align-items: center; gap: 8px;
}
.editor-preview-tab.is-active { background: rgba(255,58,0,0.15); color: var(--primary-color); font-weight: 500; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.editor-preview-split {
    display: flex; flex: 1; min-height: 0;
}
.editor-preview-pane {
    flex: 1; min-width: 0; position: relative; border-right: 1px solid var(--border-color);
}
.editor-preview-pane:last-child { border-right: none; }
.editor-preview-pane iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}

/* Skeleton – React-Style */
.instruction-card--skeleton { cursor: default; }
.instruction-card--skeleton:hover { border-color: #1F1F1F; }
.card-thumbnail--skeleton {
    background: #1A1A1A;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-line {
    height: 16px;
    border-radius: 4px;
    background: #1A1A1A;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-w3 { width: 75%; }
.skeleton-w2 { width: 50%; margin-top: 8px; }
.skeleton-w1 { width: 40%; margin-top: 8px; }
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Legacy: card-icon (z.B. andere Seiten) */
.card-icon {
    font-size: 64px;
    opacity: 0.5;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--bg-panel);
    border-radius: 8px 8px 0 0;
    margin: 0;
    padding: 40px;
}

.card-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

/* Editor – Header bleibt beim Scrollen oben, kein Durchscheinen von Inhalt */
.editor-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    padding-top: 0;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: 1400px;
    background: var(--bg-panel);
    flex-shrink: 0;
    /* Deckender Hintergrund, kein Text/Bilder dahinter sichtbar */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.editor-title-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.back-btn {
    color: var(--text-light);
    text-decoration: none;
    font-size: 18px;
    padding: 6px 8px;
    border-radius: 6px;
}
.back-btn:hover { color: var(--primary-color); background: rgba(255,58,0,0.1); }

.save-status {
    font-size: 13px;
    color: #10B981;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.save-status.is-visible { animation: saveStatusFade 2s ease-out forwards; }
@keyframes saveStatusFade {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.title-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

.title-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editor-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.editor-actions .btn {
    white-space: nowrap;
}

.editor-actions .btn i {
    font-size: 14px;
}

/* Status-Dropdown im Editor-Header: Pill-Design (Entwurf/In Prüfung/Veröffentlicht) wie Karten-Badge */
.header-status-wrap { position: relative; }

.header-status-select {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    min-width: 150px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.header-status-select:hover { filter: brightness(1.08); }
.header-status-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,92,26,0.35); }
/* Pill-Hintergrund pro Status (wie im Bild: orange Entwurf) */
.header-status-select[data-status="Entwurf"]     { background: rgba(245,158,11,0.2); border-color: rgba(245,158,11,0.35); color: #FBBF24; }
.header-status-select[data-status="In Prüfung"]  { background: rgba(59,130,246,0.15);  border-color: rgba(59,130,246,0.3);  color: #60A5FA; }
.header-status-select[data-status="Veröffentlicht"] { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: #34D399; }

.header-status-icon { font-size: 12px; opacity: 0.95; }
.header-status-label { flex: 1; text-align: left; }
.header-status-chevron { font-size: 10px; opacity: 0.7; transition: transform 0.2s; }
.header-status-wrap:has(.header-status-dropdown.is-open) .header-status-chevron { transform: rotate(180deg); }

.header-status-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 0 1px rgba(255,255,255,0.08);
    z-index: 350;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.header-status-dropdown.is-open { opacity: 1; visibility: visible; }

.header-status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-light);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
    border-radius: 8px;
    margin: 2px 6px;
}
.header-status-option i { font-size: 12px; color: #888; }
.header-status-option:hover { background: #2A2A2A; }
.header-status-option:hover i { color: #aaa; }
.header-status-option.is-selected {
    background: rgba(255,92,26,0.12);
    color: var(--primary-color);
}
.header-status-option.is-selected i { color: var(--primary-color); }

/* Aktionen-Dropdown (Mehr) */
.editor-actions-more { position: relative; }
#actionsMoreBtn { min-width: 40px; }
.editor-actions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 240px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 0;
    box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 0 1px rgba(255,255,255,0.08);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.editor-actions-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.editor-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}
.editor-dropdown-item:hover:not(:disabled) { background: #2A2A2A; }
.editor-dropdown-item:disabled { opacity: 0.5; cursor: not-allowed; }
.editor-dropdown-item--danger { color: #EF4444; }
.editor-dropdown-item--danger:hover:not(:disabled) { background: rgba(239,68,68,0.12); }
.editor-dropdown-sub-arrow { margin-left: auto; font-size: 11px; color: #666; }
.editor-dropdown-sep { height: 1px; background: var(--border-color); margin: 6px 0; }
.editor-dropdown-submenu {
    display: none;
    padding: 6px 0 6px 10px;
    border-left: 2px solid var(--primary-color);
    margin: 0 10px 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.editor-dropdown-submenu.is-visible {
    display: block;
    opacity: 1;
}
.editor-dropdown-submenu .editor-dropdown-item { padding: 8px 14px; font-size: 13px; }
.move-cat-btn.is-current { color: var(--primary-color); font-weight: 600; }

/* Modal: Neue Kategorie */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(2px);
    z-index: 400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 90%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px;
    z-index: 401;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.modal.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.modal-title { font-size: 19px; font-weight: 600; margin: 0 0 8px; color: var(--text-light); }
.modal-desc { font-size: 13px; color: #888; margin: 0 0 20px; line-height: 1.5; }
.modal-input {
    width: 100%;
    padding: 12px 16px;
    background: #0F0F0F;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}
.modal-input:focus { outline: none; border-color: var(--primary-color); }
.modal-input::placeholder { color: #555; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal-actions .btn { min-width: 100px; }

/* Settings Sheet – React-Style (Dokument-Einstellungen) */
.editor-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.editor-sheet-overlay.is-open { opacity: 1; visibility: visible; }

.editor-sheet {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #141414;
    border-left: 1px solid #1F1F1F;
    z-index: 201;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.editor-sheet.is-open { transform: translateX(0); }

.editor-sheet-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #1F1F1F;
    position: relative;
}
.editor-sheet-title { font-size: 18px; font-weight: 600; margin: 0 0 4px; color: var(--text-light); }
.editor-sheet-desc { font-size: 13px; color: #666; margin: 0; }
.editor-sheet-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}
.editor-sheet-close:hover { color: #fff; }

.editor-sheet-body {
    padding: 24px;
    overflow: auto;
    flex: 1;
}
.editor-sheet-field {
    margin-bottom: 20px;
}
.editor-sheet-field label {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}
.editor-sheet-field input,
.editor-sheet-field select,
.editor-sheet-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0F0F0F;
    border: 1px solid #1F1F1F;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}
.editor-sheet-field textarea { min-height: 80px; resize: vertical; }
.editor-sheet-field input::placeholder,
.editor-sheet-field textarea::placeholder { color: #444; }

/* Editor Empty State (keine Schritte) */
.editor-empty {
    text-align: center;
    padding: 48px 24px;
}
.editor-empty-icon {
    width: 80px; height: 80px;
    border-radius: 16px;
    background: #141414;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #2A2A2A;
}
.editor-empty-icon i { font-size: 40px; }
.editor-empty-title { font-size: 20px; font-weight: 600; margin: 0 0 8px; color: var(--text-light); }
.editor-empty-text { color: #666; margin: 0; }

/* Editor Loading (Spinner im Steps-Bereich) */
.editor-steps-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}
.editor-steps-loading i {
    font-size: 32px;
    color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.editor-content {
    width: 100%;
    max-width: 1400px;
}

.editor-section {
    margin-bottom: 30px;
}

.section-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(255, 58, 0, 0.06);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-placeholder-icon {
    font-size: 2.25rem;
    color: var(--text-gray);
}

.upload-placeholder-spinner {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.image-upload-area.is-uploading .upload-placeholder-icon { display: none !important; }
.image-upload-area.is-uploading .upload-placeholder-spinner { display: flex !important; align-items: center; justify-content: center; }
.image-upload-area.is-uploading { opacity: 0.7; pointer-events: none; }

.upload-placeholder-title {
    font-weight: 500;
    color: var(--text-light);
}

.upload-placeholder-hint {
    font-size: 13px;
    color: var(--text-gray);
}

.images-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-preview-wrapper {
    position: relative;
}

.image-preview {
    position: relative;
}

.image-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

.btn-change-image {
    margin-top: 15px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.description-input,
.warning-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.description-input {
    min-height: 120px;
}

/* Beschreibung Rich-Text-Editor */
.description-editor-wrap {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-panel);
}
.description-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
}
.desc-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-gray);
    cursor: pointer;
    transition: background var(--dur-1), color var(--dur-1);
}
.desc-toolbar-btn:hover {
    background: var(--surface-4);
    color: var(--text-light);
}
.desc-toolbar-sep {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 4px;
}
.desc-toolbar-color-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-gray);
}
.desc-toolbar-color-wrap:hover { color: var(--text-light); }
.desc-toolbar-color {
    width: 24px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}
.step-description-rich {
    min-height: 120px;
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
}
.step-description-rich:empty::before {
    content: attr(data-placeholder);
    color: var(--text-gray);
}
.step-description-rich p { margin: 0 0 0.5em 0; }
.step-description-rich p:last-child { margin-bottom: 0; }
.step-description-rich ul,
.step-description-rich ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}
.step-description-rich ul { list-style-type: disc; }
.step-description-rich ol { list-style-type: decimal; }
.step-description-rich li { margin: 0.25em 0; }

/* Step Layout (Bild/Text Spalten) */
.step-layout-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.step-layout-select {
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 14px;
    min-width: 280px;
}
.step-layout-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,58,0,0.18);
}
.step-layout-hint {
    font-size: 12px;
    color: var(--text-gray);
}

.step-layout-grid {
    display: grid;
    gap: 16px;
}
.step-layout-grid.step-layout-stack {
    grid-template-columns: 1fr;
}
.step-layout-grid.step-layout-img-left,
.step-layout-grid.step-layout-img-right {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}
.step-layout-grid.step-layout-img-right .step-layout-col--image { order: 2; }
.step-layout-grid.step-layout-img-right .step-layout-col--text { order: 1; }

@media (max-width: 900px) {
    .step-layout-grid.step-layout-img-left,
    .step-layout-grid.step-layout-img-right {
        grid-template-columns: 1fr;
    }
    .step-layout-grid.step-layout-img-right .step-layout-col--image,
    .step-layout-grid.step-layout-img-right .step-layout-col--text {
        order: initial;
    }
}

.warning-input {
    min-height: 40px;
}

/* Warnhinweis-Box modernisiert */
.editor-section-warning {
    margin-bottom: 24px;
}
.editor-section-warning .section-label {
    margin-bottom: 10px;
    color: #FACC15;
    font-size: 15px;
}
.warning-box {
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.25);
    border-left: 4px solid #FACC15;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all var(--dur-2) var(--ease-out);
}
.warning-box:hover {
    background: rgba(250, 204, 21, 0.16);
    border-color: rgba(250, 204, 21, 0.35);
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.15) inset;
}
.warning-box-icon {
    font-size: 20px;
    color: #FACC15;
    flex-shrink: 0;
    margin-top: 1px;
}
.warning-box-input {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    min-height: auto;
    resize: none;
}
.warning-box-input::placeholder {
    color: rgba(250, 204, 21, 0.6);
    font-weight: 400;
}
.warning-box-input:focus {
    outline: none;
}

/* Advanced Features */
.advanced-features {
    display: none; /* Standardmäßig ausgeblendet */
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.advanced-features.visible {
    display: block; /* Sichtbar wenn .visible Klasse vorhanden ist */
}

.advanced-features h3 {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.advanced-features h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(255,255,255,0.1), transparent);
}

.feature-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
    box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
}
.feature-section:hover {
    border-color: rgba(255,255,255,0.08);
    transform: translateX(2px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 12px rgba(0,0,0,0.25);
}
.feature-section.expanded {
    border-color: rgba(255,58,0,0.2);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 16px rgba(0,0,0,0.3);
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background var(--dur-2) var(--ease-out);
    user-select: none;
    position: relative;
}
.feature-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity var(--dur-2) var(--ease-out);
}
.feature-section.expanded .feature-header::before {
    opacity: 1;
}
.feature-header:hover {
    background: rgba(255,255,255,0.04);
}
.feature-section.expanded .feature-header {
    background: rgba(255,58,0,0.06);
}

.feature-header i {
    color: var(--primary-color);
}

.feature-icon {
    font-size: 18px;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.feature-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-light);
}

.feature-toggle {
    color: var(--text-gray);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.feature-content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-4) var(--ease-out), padding var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out);
    opacity: 0;
}
.feature-section.expanded .feature-content {
    max-height: 5000px;
    padding: 0 18px 18px 18px;
    opacity: 1;
}

.feature-section.expanded .feature-toggle {
    transform: rotate(180deg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-gray);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Notizen: eigenes Fenster, dunkel (ohne weißen Hintergrund) */
.notes-window {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #0F0F0F;
    overflow: hidden;
    min-height: 140px;
}
.notes-window:hover { border-color: #444; }
.notes-window:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(255,58,0,0.12); }
.step-notes {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
.step-notes::placeholder { color: #555; }

.btn-add-item {
    width: 100%;
    padding: 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.btn-add-item:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.item-list {
    margin-bottom: 10px;
    padding-left: 12px;
    position: relative;
}
.item-list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,58,0,0.15);
    border-radius: 1px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid rgba(255,58,0,0.3);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all var(--dur-2) var(--ease-out);
    position: relative;
}
.list-item:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.10);
    border-left-color: var(--primary-color);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.list-item:focus-within {
    border-left-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255,58,0,0.15);
}

.list-item input,
.list-item .list-item-input {
    flex: 1;
    min-width: 0;
    background: rgba(15,15,15,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text-light);
    padding: 10px 14px;
    font-size: 14px;
    transition: all var(--dur-2) var(--ease-out);
    font-weight: 400;
}
.list-item input:hover,
.list-item .list-item-input:hover {
    background: rgba(15,15,15,0.8);
    border-color: rgba(255,255,255,0.12);
}
.list-item input:focus,
.list-item .list-item-input:focus {
    outline: none;
    background: rgba(15,15,15,0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255,58,0,0.18);
}
.list-item input::placeholder,
.list-item .list-item-input::placeholder {
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}

.list-item button {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 8px 10px;
    transition: all var(--dur-2) var(--ease-out);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.list-item button:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #EF4444;
    transform: scale(1.05);
}

/* Steps Container */
#stepsContainer {
    width: 100%;
    max-width: 1400px;
}

.step-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.step-header:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.step-grip {
    color: var(--text-gray);
    opacity: 0.6;
    cursor: grab;
    font-size: 14px;
}

.step-toggle-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s;
}

.step-toggle-btn:hover {
    color: var(--text-light);
}

.step-toggle-icon {
    transition: transform 0.2s ease;
}

.step-container.collapsed .step-content {
    display: none;
}

.step-container.collapsed .step-toggle-icon {
    transform: rotate(-90deg);
}

.step-action-btn.step-action-delete:hover:not(:disabled) {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.step-number-badge {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 58, 0, 0.25);
}

.step-title-input {
    flex: 1;
    padding: 10px 15px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

.step-title-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.step-actions {
    display: flex;
    gap: 5px;
}

.step-action-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.step-action-btn:hover:not(:disabled) {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.step-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.step-content {
    margin-top: 20px;
}

.btn-remove-image {
    margin-top: 10px;
    padding: 6px 12px;
    background: #DC2626;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove-image:hover {
    background: #B91C1C;
}

.btn-add-step {
    width: 100%;
    padding: 24px 16px;
    background: transparent;
    border: 2px dashed #2A2A2A;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-gray);
    cursor: pointer;
    margin-top: 24px;
    max-width: 1400px;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-add-step:hover {
    border-color: rgba(255, 58, 0, 0.5);
    background: rgba(255, 58, 0, 0.06);
    color: var(--primary-color);
}
.btn-add-step i { font-size: 18px; }

/* Preview */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: 1400px;
    flex-wrap: wrap;
    gap: 16px;
}

.preview-title-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.preview-title-block { min-width: 0; }
.preview-title-block h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: var(--text-light);
}
.preview-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}
.preview-meta-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.preview-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,58,0,0.12);
    border: 1px solid rgba(255,58,0,0.25);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
}
.preview-category-badge i { font-size: 11px; opacity: 0.9; }

.preview-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.preview-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
}
.preview-zoom .icon-btn {
    padding: 6px 10px;
    border-radius: 6px;
}
.preview-zoom .icon-btn:hover { background: rgba(255,255,255,0.06); }
.preview-zoom #previewZoomVal { min-width: 48px; text-align: center; font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.preview-doc-scale {
    transform-origin: top center;
    max-width: 210mm;
    margin: 0 auto;
    width: 100%;
}

.preview-empty-state {
    text-align: center;
    padding: 80px 24px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.preview-empty-state .preview-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #333;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.preview-empty-state h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text-light);
}

.preview-empty-state p {
    color: var(--text-secondary);
    margin: 0 0 28px 0;
    line-height: 1.5;
}

.preview-empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.preview-empty-actions .btn { display: inline-flex; align-items: center; gap: 8px; }

.preview-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.preview-document {
    background: transparent;
    width: 100%;
    max-width: 900px;
    color: #000;
    margin: 0 auto;
}

.preview-header-section {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    margin: -40px -40px 30px -40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 12px rgba(255, 58, 0, 0.25);
}

.preview-title {
    font-size: 24px;
    font-weight: bold;
}

.preview-badge {
    display: inline-flex;
    gap: 10px;
    font-size: 12px;
}

.preview-warning {
    background: #FACC15;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(250, 204, 21, 0.2);
    color: #000;
}

.preview-section {
    margin-bottom: 25px;
}

.preview-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.preview-section-number {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 58, 0, 0.25);
}

.preview-step {
    margin-bottom: 60px;
    animation: fadeIn 0.4s ease-in;
}

.preview-description ul,
.preview-description ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}
.preview-description ul { list-style-type: disc; }
.preview-description ol { list-style-type: decimal; }
.preview-description li { margin: 0.25em 0; }

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

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .no-print,
    .sidebar,
    .preview-header {
        display: none !important;
    }
    .main-content {
        max-width: 100% !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }
    .preview-container {
        padding: 0 !important;
        min-height: auto !important;
    }
    .preview-doc-scale {
        transform: none !important;
        max-width: 100% !important;
    }
    .preview-document,
    .preview-document * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Settings */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: 1400px;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-light);
}

.tab-btn.active {
    color: white;
    background: var(--primary-color);
    border-bottom-color: var(--primary-color);
    border-radius: 6px 6px 0 0;
}

.tab-btn.active i {
    color: white;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-content {
    width: 100%;
    max-width: 1400px;
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.settings-card h3 {
    margin-bottom: 25px;
    font-size: 18px;
}

.setting-description {
    color: var(--text-gray);
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-info label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.setting-info p {
    color: var(--text-gray);
    font-size: 13px;
}

.setting-item select {
    padding: 10px 15px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
}

.color-swatches {
    display: flex;
    gap: 10px;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #F5F5F5;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-panel);
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid var(--border-color);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-gray);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: white;
}

/* Modal (Overlay-Container nur für Modals mit .modal-content, z.B. Template-Upload) – .modal--new-category nutzt die obere .modal-Regel (Zentrierung) */
.modal:has(> .modal-content) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-body {
    padding: 30px;
}

.modal-subtitle {
    color: var(--text-gray);
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.file-type {
    color: var(--text-gray);
    font-size: 12px;
    margin-top: 5px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 20px;
    color: var(--text-gray);
}

.empty-icon i {
    font-size: 64px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 30px;
}

/* Templates */
.search-bar {
    width: 100%;
    max-width: 1400px;
    margin-bottom: 30px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1400px;
}

@media (max-width: 1200px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

.template-section {
    width: 100%;
    max-width: 1400px;
    margin-bottom: 48px;
}

.template-section__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.template-section__desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.template-section.is-empty .templates-grid { display: none; }

.template-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.template-card:hover {
    border-color: rgba(255, 58, 0, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.template-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(255, 58, 0, 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.template-card--uploaded .template-card__icon {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.template-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.template-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card__category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-gray);
}

.template-card__action {
    margin-top: 4px;
}

.template-card__action .btn {
    width: 100%;
    justify-content: center;
}

.btn-use-template {
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .logo-text,
    .sidebar .nav-item span:not(.nav-icon),
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 15px;
        width: calc(100% - 70px);
    }
    
    .sidebar {
        width: 70px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-actions {
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* Bildeditor Styles */
.image-preview-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.btn-edit-image,
.btn-change-image,
.btn-remove-image {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

.btn-edit-image:hover {
    background: var(--primary-hover);
}

.btn-change-image {
    background: var(--bg-card);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-change-image:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
}

.btn-remove-image {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.btn-remove-image:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.modal--image-editor {
    max-width: 98vw;
    width: 1400px;
    max-height: 98vh;
    display: flex !important;
    flex-direction: column;
    z-index: 402 !important; /* Höher als Overlay */
}

.modal--image-editor.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

.image-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.image-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-editor-toolbar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel);
    flex-wrap: wrap;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.zoom-level-input {
    width: 60px;
    padding: 8px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
}

.zoom-level-input::-webkit-outer-spin-button,
.zoom-level-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.zoom-level-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.zoom-level-suffix {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    margin-left: 4px;
}

.toolbar-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.toolbar-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
}

.toolbar-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.toolbar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 12px;
    white-space: nowrap;
}

.toolbar-slider {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.toolbar-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}
.toolbar-slider::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.color-input-small {
    width: 40px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.toolbar-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}
.toolbar-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.image-editor-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--bg-dark);
    position: relative;
    min-height: 500px;
}

#imageEditorCanvas {
    max-width: 100%;
    max-height: calc(98vh - 300px); /* Platz für Toolbar und Header/Footer */
    width: auto;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: white;
    cursor: crosshair;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.image-editor-text-panel {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-panel);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.text-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
}

.color-input {
    width: 50px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.size-slider {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.size-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}
.size-slider::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}
.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}
.size-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Diagramm-Editor Styles */
.diagram-editor-container {
    display: flex;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.diagram-toolbar {
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toolbar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.toolbar-shapes,
.toolbar-actions,
.toolbar-properties {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toolbar-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.toolbar-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
}

.toolbar-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.toolbar-btn i {
    width: 20px;
    text-align: center;
}

.toolbar-properties {
    gap: 16px;
}

.property-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-light);
    font-size: 13px;
}

.property-label span {
    font-weight: 500;
}

.range-input {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.range-input::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}
.range-input::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}
.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}
.range-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.diagram-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #F5F5F5;
}

#diagramCanvas {
    display: block;
    cursor: crosshair;
}

.diagram-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diagram-item {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.diagram-item:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
}

.diagram-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.diagram-item-meta {
    font-size: 12px;
    color: var(--text-gray);
}

.image-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}
