:root {
    --bs-primary: #0f6e6b;
    --bs-primary-rgb: 15, 110, 107;
    --bs-body-bg: #f3f6f6;
    --bs-body-color: #1d2a2a;
    --ink: #163331;
}

body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.side-nav {
    width: 240px;
    flex-shrink: 0;
    background: var(--ink);
    color: #fff;
    padding: 1.25rem 0.85rem;
}

.side-brand {
    display: block;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.side-user {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

.side-caption {
    margin: 0.8rem 0.75rem 0.35rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
}

.side-menu a,
.side-menu button {
    display: block;
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    text-align: left;
    text-decoration: none;
}

.side-menu a:hover,
.side-menu a:focus,
.side-menu a.active,
.side-menu button:hover,
.side-menu button:focus,
.side-folder:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.side-group {
    margin-bottom: 0.25rem;
}

.side-group summary {
    list-style: none;
}

.side-group summary::-webkit-details-marker {
    display: none;
}

.side-folder {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}

.side-children {
    margin-left: 0.85rem;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.mobile-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: #fff;
}

.mobile-bar button {
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    padding: 0.35rem 0.7rem;
}

.app-content {
    padding: 1.5rem;
}

.panel {
    background: #fff;
    border: 1px solid rgba(22, 51, 49, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
}

.level-badge {
    background: rgba(15, 110, 107, 0.12);
    color: var(--ink);
}

#menu-form {
    scroll-margin-top: 1rem;
}

.waterfall {
    position: relative;
    margin-left: 8px;
    padding-left: 22px;
}

.waterfall::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #0f6e6b;
}

.wf-node {
    position: relative;
}

.wf-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 8px 0;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e3eeee;
    border-radius: 12px;
}

.wf-row::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 22px;
    height: 2px;
    background: #0f6e6b;
}

.wf-row.is-editing {
    background: #e8f5f4;
    border-color: #0f6e6b;
}

.wf-level {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 3px 8px;
    background: #e7f4f3;
    color: #0f6e6b;
    font-size: 12px;
    font-weight: 700;
}

.wf-name {
    flex: 0 0 120px;
    color: #163331;
    font-weight: 700;
}

.wf-path {
    flex: 1 1 auto;
    min-width: 0;
    color: #0f6e6b;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-meta {
    flex: 0 0 auto;
    color: #6d7c7b;
    font-size: 12px;
}

.wf-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.wf-actions form {
    margin: 0;
}

.wf-node > .waterfall {
    margin-left: 28px;
}

@media (max-width: 767px) {
    .side-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        transform: translateX(-105%);
    }

    .side-nav.open {
        transform: none;
    }

    .mobile-bar {
        display: flex;
    }
}
