/*
 * Define o layout principal da aplicação (Sidebar + Conteúdo)
 */

body {
    display: flex;
    overflow: hidden;
    height: 100vh;
}

.sidebar {
    width: 270px;
    background: #f7f7f7;
    color: #212121;
    padding: 0 0 24px 0;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    transition:
        width 0.8s ease-in-out,
        padding 0.3s ease-in-out,
        opacity 0.3s ease-in-out;
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #989898;
    padding-top: 18px;
    padding-left: 16px;
    margin-top: 0;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eeeeee;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.sidebar-team-list {
    list-style: none;
    padding: 0 12px;
    margin: 0;
    transition: opacity 0.2s 0.1s;
    white-space: nowrap;
}

details.team-item {
    display: grid;
    grid-template-rows: auto 1fr;
}

.team-item {
    margin-bottom: 14px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.sidebar-team-name {
    font-size: 0.99rem;
    color: #989898;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-top: 14px;
    margin-bottom: 8px;
    padding-left: 12px;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.team-products-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.9s ease-in-out;
    overflow: hidden;
}

details[open] > .team-products-wrapper {
    grid-template-rows: 1fr;
}

.sidebar-product-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    min-height: 0;
}

.product-link a {
    display: block;
    color: #9e9e9e;
    text-decoration: none;
    padding: 14px 14px;
    border-radius: 4px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.product-link a:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.product-link a.active {
    background-color: #eeeeee;
    font-weight: 600;
    color: #424242;
    padding: 12px px;
}

.sidebar-empty {
    padding-left: 1rem;
    font-style: italic;
    opacity: 0.7;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.content {
    flex-grow: 1;
    padding: 30px 40px;
    overflow-y: auto;
    background-color: #ffffff;
    height: 100%;
    box-sizing: border-box;
}

.content-header {
    margin-bottom: 24px;
}
.content-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

body.sidebar-collapsed .sidebar {
    width: 0px;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    border-right: none;
}

body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-team-list {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.team-item[open] > .sidebar-team-name .team-arrow {
    transform: rotate(180deg);
}

.sidebar,
.content {
    scrollbar-color: #bdc3c7 #f7f7f7;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f7f7f7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background-color: #bdc3c7;
    border-radius: 4px;
    border: 2px solid #f7f7f7;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #95a5a6;
}
