body {
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.auth-body {
    background: linear-gradient(135deg, #dde8f5, #f8fbff 45%, #dceede);
}

.portal-body {
    background: var(--portal-bg);
    color: var(--portal-text);
}

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

.portal-sidebar {
    width: 320px;
    background: #13263b;
    color: #f7fbff;
    padding: 1.25rem;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.portal-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 0.25rem;
}

.portal-main {
    flex: 1;
    padding: 1.25rem;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.portal-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.portal-content {
    background: rgba(255, 255, 255, 0.9);
}

.tree-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.35rem;
}

.tree-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #d9e6f5;
    text-decoration: none;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
}

.tree-image-icon {
    width: 1.1rem;
    height: 1.1rem;
    object-fit: contain;
    flex: 0 0 auto;
}

.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem;
    max-height: 320px;
    overflow: auto;
    padding: 0.25rem;
    border: 1px solid #d8e0ea;
    border-radius: 0.75rem;
    background: #fff;
}

@media (min-width: 1200px) {
    .icon-picker {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.icon-picker-option {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    padding: 0.75rem 0.5rem;
    border: 1px solid #d8e0ea;
    border-radius: 0.75rem;
    cursor: pointer;
    text-align: center;
    background: #f8fbff;
}

.icon-picker-option.selected {
    border-color: #0d6efd;
    background: #eaf2ff;
    box-shadow: inset 0 0 0 1px #0d6efd;
}

.icon-picker-option input {
    display: none;
}

.icon-picker-preview {
    font-size: 1.4rem;
    line-height: 1;
}

.icon-picker-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.icon-picker-code {
    font-size: 0.75rem;
    color: #6c757d;
}

.color-input-group {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.color-input-group .form-control-color {
    width: 3.25rem;
    min-width: 3.25rem;
    padding: 0.25rem;
}

.organisation-tree-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.organisation-tree-branch {
    color: #6c757d;
    font-weight: 600;
}

@media (max-width: 576px) {
    .color-input-group {
        grid-template-columns: 1fr;
    }

    .color-input-group .form-control-color {
        width: 100%;
    }
}

.tree-link.active,
.tree-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.tree-toggle,
.tree-spacer {
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: #d9e6f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tree-toggle[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.tree-toggle i {
    transition: transform 0.2s ease;
}

.portal-nav .tree-list .tree-list {
    padding-left: 1.2rem;
}

@media (max-width: 992px) {
    .portal-shell {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
    }

    .portal-header {
        flex-direction: column;
        align-items: stretch;
    }
}
