:root {
    --bg-main: #1e1f22;
    --bg-side: #2b2d31;
    --bg-card: #313338;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --text-primary: #f2f3f5;
    --text-muted: #949ba4;
    --border: #3f4147;
    --success: #23a559;
    --danger: #da373c;
}

/* --- BASIS & LAYOUT --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    display: flex; /* Sidebar links, Content rechts */
    height: 100vh;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- SIDEBAR (Das Sideboard) --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-side);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: 0.2s;
}

.sidebar-nav a:hover {
    background-color: rgba(79, 84, 92, 0.16);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 15px 10px;
}

.sidebar-label {
    padding: 0 15px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- HAUPTBEREICH --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.container {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* --- CARDS --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* --- PANELS --- */
.panel {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    height: calc(100vh - 80px); /* Angepasst an Container Padding */
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s ease, border 0.3s ease;
}

.panel-header {
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* --- MESSAGES & NOTIZEN --- */
.msg {
    background: var(--bg-side);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid transparent;
    position: relative;
    animation: fadeIn 0.3s ease forwards;
}

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

.msg.pinned { 
    border-left-color: var(--accent); 
    background: rgba(88, 101, 242, 0.05);
}

.msg strong {
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

/* --- CHECKBOX / TO-DO STYLING --- */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
}

input[type="checkbox"]:checked {
    background-color: var(--success);
    border-color: var(--success);
}

input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- DRAG & DROP --- */
.draggable { cursor: grab; }
.draggable:active { cursor: grabbing; }
.dragging { opacity: 0.5; border: 2px dashed var(--accent); }

.drop-zone-active { 
    background: rgba(88, 101, 242, 0.1) !important; 
    border: 2px dashed var(--accent) !important; 
}

/* --- REACTIONS --- */
.reactions {
    margin-top: 8px;
    display: flex;
    gap: 5px;
}

.react-btn {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}

.react-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.reaction-picker {
    display: none;
    position: absolute;
    top: -35px;
    right: 10px;
    background: var(--bg-side);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

.msg:hover .reaction-picker { display: flex; }

.emoji-opt {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: 0.2s;
}

.emoji-opt:hover { background: var(--bg-card); transform: scale(1.2); }

/* --- INPUTS --- */
.input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
}

input[type="text"] {
    flex: 1;
    background: var(--bg-side);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover { background: var(--accent-hover); }
button:active { transform: scale(0.95); }

.text-danger { color: var(--danger); }
.text-success { color: var(--success); }