:root {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #ef4444;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

body { font-family: 'Inter', sans-serif; margin: 0; background-color: var(--bg-body); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; }
* { box-sizing: border-box; }

/* Login */
.login-wrapper { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: var(--bg-surface); padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; text-align: center; }
.login-box h2 { margin: 0 0 24px; font-weight: 700; font-size: 24px; }
.input-field { width: 100%; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; outline: none; transition: border 0.2s; font-family: 'Inter', sans-serif;}
.input-field:focus { border-color: var(--primary); }
.btn-primary { width: 100%; background: var(--primary); color: white; padding: 12px; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: var(--primary-hover); }

/* Navbar & Dashboard */
.navbar { background: var(--bg-surface); border-bottom: 1px solid var(--border); padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); z-index: 10;}
.brand { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.user-menu { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 16px; }
.logout-link { color: var(--danger); text-decoration: none; font-weight: 500; }

.container { max-width: 1200px; margin: 0 auto; padding: 32px; flex-grow: 1; width: 100%; }

/* Kategorien */
.category-wrapper { background: white; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.section-title { font-size: 18px; font-weight: 700; margin: 0 0 20px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.main-title { font-size: 24px; font-weight: 800; margin: 0 0 24px; }

/* Grid (Templates) */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--bg-body); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; gap: 12px; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cbd5e1; background: white; }
.card-icon { width: 36px; height: 36px; background: #eff6ff; color: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.card-title { font-weight: 600; font-size: 14px; margin: 0; }

/* File Browser */
.file-browser { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); margin-top: 40px;}
.fb-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; background: #f8fafc; }
.fb-nav-btn { padding: 8px 16px; border: 1px solid var(--border); background: white; border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-main); transition: 0.2s;}
.fb-nav-btn:hover { background: #f1f5f9; }
.fb-active-btn { background: var(--primary); color: white; border-color: var(--primary); }
.fb-active-btn:hover { background: var(--primary-hover); }

.fb-toolbar { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.breadcrumb-item { cursor: pointer; color: var(--text-main); font-weight: 500; }
.breadcrumb-item:hover { text-decoration: underline; }
.breadcrumb-separator { color: #cbd5e1; }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border); transition: all 0.2s; font-size: 14px; font-weight: 500;}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #f8fafc; }
.file-draggable { cursor: grab; }
.file-draggable:active { cursor: grabbing; }
.drag-over { background-color: #eff6ff !important; box-shadow: inset 0 0 0 2px var(--primary) !important; }
.file-info-area { display: flex; align-items: center; gap: 12px; flex-grow: 1; cursor: pointer; padding: 6px 0; }
.file-icon { color: var(--text-muted); display: flex; align-items: center;}

.btn-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: var(--radius); transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-delete:hover { background: #fee2e2; color: var(--danger); }

/* Editor Fullscreen */
#editor-section { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-body); z-index: 100; flex-direction: column; }
.editor-toolbar { background: var(--bg-surface); padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.editor-controls { display: flex; gap: 12px; align-items: center; }
.editor-iframe { flex-grow: 1; border: none; width: 100%; background: white; }

#status-toast { position: fixed; bottom: 24px; right: 24px; background: #1e293b; color: white; padding: 12px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); transition: opacity 0.3s; opacity: 0; pointer-events: none; z-index: 1000;}
svg { width: 20px; height: 20px; }