html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #2d2d2d;
    color: #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}

/* ====== Navbar (Desktop) ====== */
.navbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid #3a3a3a;
}
.brand {
    color: #ececec;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ====== Section-Subnav (Soul/Skills/Schedules ODER Neu/Bearbeiten/Loeschen) ====== */
.section-subnav { display: flex; gap: 0.6rem; }
.section-subnav[hidden] { display: none; }

.subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    background: transparent;
    border: 1px solid #ececec;
    border-radius: 6px;
    color: #ececec;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    font-family: inherit;
}
.subnav-item svg { width: 15px; height: 15px; }
.subnav-item:hover { color: #b8b8b8; border-color: #b8b8b8; }
.subnav-item.active {
    color: #6a6a6a;
    border-color: #6a6a6a;
    background: rgba(255,255,255,0.03);
    cursor: default;
}

/* ====== Nav-Items (rechts) ====== */
.nav-items {
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}
.nav-item {
    color: #ececec;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}
.nav-icon { width: 22px; height: 22px; display: none; }
.nav-item:hover { color: #8a8a8a; }
.nav-item.active { color: #6a6a6a; cursor: default; }

/* ====== Content ====== */
.content {
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}
.section-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.section-view[hidden] { display: none; }

/* ====== Explorer ====== */
.explorer {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1px 1fr 1px 2fr;
    overflow: hidden;
}
.divider { background: #3a3a3a; }
.col {
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.col::-webkit-scrollbar { width: 6px; height: 6px; }
.col::-webkit-scrollbar-track { background: transparent; }
.col::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.10);
    border-radius: 3px;
    transition: background 0.2s ease;
}
.col:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
.col::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }

.entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    color: #ececec;
    font-size: 0.92rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.entry:hover { background: rgba(255,255,255,0.04); }
.entry.selected { background: rgba(255,255,255,0.07); color: #b8b8b8; }
.entry-icon { width: 14px; height: 14px; flex-shrink: 0; }
.col3 pre {
    margin: 0;
    padding: 0.75rem 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #d8d8d8;
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}
.placeholder {
    padding: 1rem;
    color: #6a6a6a;
    font-size: 0.85rem;
    font-style: italic;
}

/* ====== Clients: Cards ====== */
.cards {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.cards::-webkit-scrollbar { width: 6px; }
.cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 3px; }
.cards:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }

.card {
    background: #353535;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    color: #ececec;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.card:hover {
    border-color: #6a6a6a;
    background: #3a3a3a;
    transform: translateY(-1px);
}
.card-name {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}
.card-sub {
    font-size: 0.78rem;
    color: #8a8a8a;
    line-height: 1.4;
}

/* ====== Modal ====== */
.modal { position: fixed; inset: 0; z-index: 100; }
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
}
.modal-card {
    position: relative;
    width: min(440px, calc(100% - 2rem));
    margin: 8vh auto 0;
    background: #353535;
    border: 1px solid #4a4a4a;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-card h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 500;
    color: #ececec;
}
.modal-card form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.modal-card label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: #b8b8b8;
}
.modal-card input {
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    color: #ececec;
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}
.modal-card input:focus {
    outline: none;
    border-color: #888;
}
.modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}
.modal-actions-right {
    display: flex;
    gap: 0.6rem;
    margin-left: auto;
}
.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary {
    background: #ececec;
    border: 1px solid #ececec;
    color: #2d2d2d;
    font-weight: 500;
}
.btn-primary:hover { background: #ffffff; }
.btn-secondary {
    background: transparent;
    border: 1px solid #6a6a6a;
    color: #ececec;
}
.btn-secondary:hover { border-color: #ececec; }
.btn-danger {
    background: transparent;
    border: 1px solid #a35454;
    color: #d88080;
}
.btn-danger:hover {
    background: rgba(163,84,84,0.15);
    border-color: #c47070;
    color: #f0a0a0;
}

/* ====== Mobile ====== */
@media (max-width: 768px) {
    .navbar { display: contents; }
    .brand { display: none; }

    .section-subnav {
        position: fixed;
        top: 0; left: 0; right: 0;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
        overflow-x: auto;
        background: #2d2d2d;
        border-bottom: 1px solid #3a3a3a;
        z-index: 10;
        scrollbar-width: none;
    }
    .section-subnav::-webkit-scrollbar { display: none; }
    .subnav-item { white-space: nowrap; flex-shrink: 0; }

    .nav-items {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 80px;
        gap: 0;
        background: #2d2d2d;
        border-top: 1px solid #3a3a3a;
        justify-content: space-around;
        z-index: 10;
    }
    .nav-item {
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        flex: 1;
        font-size: 0.7rem;
        letter-spacing: 0.03em;
        padding-bottom: 8px;
    }
    .nav-icon { display: block; }

    .content {
        margin-top: 3rem;
        height: calc(100vh - 3rem - 80px);
    }

    .explorer {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1px 1fr 1px 1fr;
    }
    .divider { height: 1px; }

    .cards { padding: 1rem; grid-template-columns: 1fr; }
}
