/* Navbar */
.navbar {
    background: #181818;
    border-right: 1px solid #2a2d2e;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0 10px;
    gap: 10px;
    width: 260px;
    min-height: 100vh;
    box-shadow: none;
}

.nav-sidebar-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 8px;
}

.nav-sidebar-label,
.nav-section-title {
    color: #8c8c8c;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-brand {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cccccc;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
}

.nav-brand a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}

.nav-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0 8px;
}

.nav-section-tree {
    overflow-y: auto;
    padding-bottom: 8px;
}

.nav-tree {
    display: flex;
    flex-direction: column;
}

.nav-folder {
    display: flex;
    flex-direction: column;
}

.nav-folder-header {
    display: flex;
    align-items: center;
}

.nav-folder-link,
.nav-file-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: #cccccc;
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 0.84rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

.nav-folder-toggle {
    width: 18px;
    height: 30px;
    border: 0;
    background: transparent;
    position: relative;
    cursor: pointer;
    flex: 0 0 18px;
}

.nav-folder-toggle::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #8c8c8c;
    transform: translateY(-50%);
    transition: transform 0.16s ease;
}

.nav-folder-link {
    position: relative;
    padding-left: 26px;
}

.nav-folder-link::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    width: 11px;
    height: 9px;
    border: 1px solid #7f6a2a;
    border-top-width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #d7ba7d 0%, #b8954a 100%);
    transform: translateY(-50%);
}

.nav-folder.is-open > .nav-folder-header > .nav-folder-toggle::before {
    transform: translateY(-50%) rotate(90deg);
}

.nav-folder-root > .nav-folder-header > .nav-folder-link {
    font-weight: 600;
}

.nav-folder-root > .nav-folder-header > .nav-folder-link::before {
    background: linear-gradient(180deg, #c9a962 0%, #9c7a37 100%);
}

.nav-folder-children {
    display: flex;
    flex-direction: column;
}

.nav-folder-children[hidden] {
    display: none;
}

.nav-folder-root > .nav-folder-children {
    padding-left: 12px;
}

.nav-folder:not(.nav-folder-root) > .nav-folder-children {
    padding-left: 16px;
}

.nav-folder-toggle:hover,
.nav-folder-link:hover,
.nav-file-link:hover {
    color: #ffffff;
    background: #2a2d2e;
}

.nav-file-link {
    position: relative;
    padding-left: 44px;
    color: #b9b9b9;
}

.nav-file-link::before {
    content: "";
    position: absolute;
    left: 26px;
    top: 50%;
    width: 10px;
    height: 12px;
    border: 1px solid #6b6b6b;
    border-radius: 2px;
    background: linear-gradient(180deg, #2f2f2f 0%, #252526 100%);
    transform: translateY(-50%);
}

.nav-user {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: auto;
    padding: 12px 8px 0;
    border-top: 1px solid #2a2d2e;
}


.nav-user-name {
    color: #cccccc;
    font-size: 0.82rem;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 600;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.back-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid #3c3c3c;
    color: #cccccc;
}

.btn-outline:hover {
    background: #2a2d2e;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 5px 16px;
    height: 100%;
}

.nav-action {
    justify-content: flex-start;
    width: 100%;
    min-height: 30px;
    border-radius: 4px;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .navbar {
        width: 100%;
        min-height: auto;
        max-height: 42vh;
        border-right: 0;
        border-bottom: 1px solid #2a2d2e;
    }

    .nav-section-tree {
        overflow-y: auto;
    }
}

