:root {
    --bg: #121212;
    --panel: #1e1e1e;
    --panel-light: #2c2c2c;
    --border: #404040;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --brandColor: #007a3e;
    --brandColorDark: #005a2e;
    --danger: #d32f2f;
    --font-stack: 'Segoe UI', 'Inter', Roboto, sans-serif;
}

* { box-sizing: border-box; outline: none; }
body { margin: 0; background-color: var(--bg); color: var(--text); font-family: var(--font-stack); height: 100vh; overflow: hidden; }

/* Login */
#login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 1000; display: flex; align-items: center; justify-content: center; transition: opacity 0.5s ease; }
.login-box { text-align: center; width: 100%; max-width: 420px; padding: 40px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); border-top: 4px solid var(--brandColor); }
/* ÄNDERUNG HIER: Weißer Hintergrund entfernt */
.login-logo { max-width: 250px; margin-bottom: 20px; } 
.login-box h1 { margin: 10px 0; font-size: 20px; color: white; font-weight: 600; }
.login-box input { width: 100%; padding: 12px; margin: 20px 0; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: white; border-radius: 6px; font-size: 16px; text-align: center; }
.login-box input:focus { border-color: var(--brandColor); }

/* Layout */
#app-container { display: none; display: grid; grid-template-columns: 320px 1fr; grid-template-rows: 70px 1fr 30px; height: 100vh; }

/* Header */
header { grid-column: 1 / -1; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.brand-wrap { display: flex; align-items: center; gap: 15px; }
/* ÄNDERUNG HIER: Weißer Hintergrund entfernt */
.header-logo { height: 45px; }
.brand-text { font-weight: 700; font-size: 18px; color: white; letter-spacing: 0.5px; }
.header-actions { display: flex; gap: 10px; }

/* Sidebar */
aside { background: var(--panel-light); border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.search-bar { padding: 15px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.search-bar input { width: 100%; background: #121212; border: 1px solid var(--border); padding: 10px; color: white; border-radius: 4px; }

/* Tree View */
.tree-container { padding: 10px; }
.tree-node { margin-left: 10px; }
.tree-label { padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: 14px; border-radius: 4px; transition: 0.1s; }
.tree-label:hover { background: rgba(255,255,255,0.05); color: white; }
.tree-label i.folder-icon { color: var(--brandColor); margin-right: 8px; }
.tree-action { opacity: 0; color: var(--text-muted); padding: 4px; }
.tree-label:hover .tree-action { opacity: 1; }
.tree-action:hover { color: white; }
.tree-children { display: none; border-left: 1px solid #444; margin-left: 11px; padding-left: 5px; }
.tree-node.open > .tree-children { display: block; }
.tree-device { padding: 8px 10px; margin-left: 18px; cursor: pointer; font-size: 13px; color: #bbb; display: flex; align-items: center; gap: 8px; border-radius: 4px; }
.tree-device:hover { color: white; background: var(--brandColor); }
.tree-device.active { color: white; background: var(--brandColor); font-weight: bold; }

/* Main Content */
main { background: var(--bg); overflow-y: auto; padding: 30px; }
.device-details { max-width: 1000px; margin: 0 auto; }
.detail-header { display: flex; justify-content: space-between; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.dh-title h2 { margin: 0; color: white; font-size: 26px; }
.dh-title span { color: var(--brandColor); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; font-weight: bold; }

/* Forms */
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select { background: var(--panel); border: 1px solid var(--border); padding: 12px; color: white; border-radius: 6px; font-family: inherit; width: 100%; }
.form-group input:focus { border-color: var(--brandColor); }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; margin-top: 20px; }
.gallery-item { aspect-ratio: 16/9; background: #000; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn { border: 2px dashed var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); }
.upload-btn:hover { border-color: var(--brandColor); color: var(--brandColor); }

/* Footer */
footer { grid-column: 1 / -1; background: #000; border-top: 1px solid var(--border); color: #666; font-size: 11px; text-align: center; display: flex; align-items: center; justify-content: center; }

/* Buttons & Modal */
.btn { padding: 10px 20px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.btn-primary { background: var(--brandColor); color: white; }
.btn-primary:hover { background: var(--brandColorDark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: white; color: white; }
.btn-danger { background: var(--danger); color: white; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.2s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-box { background: var(--panel); border: 1px solid var(--border); padding: 30px; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 900px) { #app-container { grid-template-columns: 1fr; grid-template-rows: 70px auto 1fr 30px; } aside { height: 250px; } .grid-form { grid-template-columns: 1fr; } }