:root {
    --bg: #1a1d24;
    --surface: #242832;
    --surface-2: #2d323e;
    --border: #3a4050;
    --text: #e8eaed;
    --text-dim: #9aa0ac;
    --accent: #6b5bff;
    --accent-hover: #7c6dff;
    --danger: #e5484d;
    --radius: 8px;
}

* { box-sizing: border-box; }

/* Sicherheitsnetz: [hidden] muss IMMER gewinnen, egal welche andere Regel
   sonst noch einen display-Wert für dasselbe Element setzt. Ohne dieses
   !important kann eine simple Klassen-Regel wie "display: flex" das
   hidden-Attribut unbemerkt komplett wirkungslos machen. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.btn-ghost {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.login-form {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--border);
}
.login-form h1 { font-size: 20px; margin: 0 0 8px; text-align: center; }
.login-form label { font-size: 13px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; }
.login-form input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}
.login-form button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 6px;
}
.login-form button:hover { background: var(--accent-hover); }
.login-form .error { color: var(--danger); font-size: 13px; margin: 0; }

/* Board grid (Übersicht) */
.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px;
}
.board-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
    cursor: pointer;
}
.board-tile:hover { border-color: var(--accent); }
.board-tile-new { background: transparent; border-style: dashed; color: var(--text-dim); }

/* Board view (Listen + Karten) */
.board-view {
    display: flex;
    gap: 14px;
    padding: 20px;
    overflow-x: auto;
    align-items: flex-start;
    height: calc(100vh - 57px);
}
.list {
    background: var(--surface);
    border-radius: var(--radius);
    width: 260px;
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}
.list.drag-over { outline: 2px dashed var(--accent); }
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
}
.list-name { outline: none; flex: 1; }
.list-archive-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
}
.list-archive-btn:hover { color: var(--danger); }
.cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 20px;
}
.card {
    background: var(--surface-2);
    border-radius: 6px;
    padding: 10px;
    cursor: grab;
    border: 1px solid transparent;
    font-size: 13px;
}
.card:hover { border-color: var(--accent); }
.card.dragging { opacity: 0.4; }
.card-name { line-height: 1.4; }
.card-due {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-dim);
    display: inline-block;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}
.add-card-btn, .add-list-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
}
.add-card-btn:hover, .add-list-btn:hover { color: var(--text); }
.add-list-btn {
    background: var(--surface);
    border-radius: var(--radius);
    width: 220px;
    flex: 0 0 220px;
    height: 42px;
    border: 1px dashed var(--border);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    z-index: 100;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    position: relative;
    border: 1px solid var(--border);
}
.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.modal-close:hover, .modal-close:active { background: var(--surface-2); color: var(--text); }
.modal-title {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 14px;
}
.modal-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 14px;
}
.modal-label input, .modal-label textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.modal-actions--end { justify-content: flex-end; gap: 10px; }
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.btn-danger:hover { background: rgba(229,72,77,0.1); }

/* Userverwaltung */
.users-page { padding: 24px; max-width: 700px; margin: 0 auto; }
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}
.users-table th, .users-table td {
    text-align: left;
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.users-table th { color: var(--text-dim); font-weight: 600; }
.users-table tr:last-child td { border-bottom: none; }
.users-table .btn-ghost, .users-table .btn-danger, .users-table .btn-primary { padding: 6px 10px; font-size: 12px; }
.users-table code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
