/* =========================================================
   GOODLINE CORE - LAYOUT
   Estrutura da aplicação, sidebar, conteúdo, footer e login.
========================================================= */

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

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;

    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: var(--sidebar-background);
    color: var(--sidebar-text);
}

.sidebar-brand {
    height: var(--topbar-height);

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 20px;

    border-bottom: 1px solid rgba(185, 230, 255, 0.18);
}

.brand-logo {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: var(--primary);
    color: var(--sidebar-text);

    font-weight: 700;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    font-size: 16px;
}

.brand-text span {
    color: var(--sidebar-text-muted);
    font-size: 11px;
}

.sidebar-menu {
    flex: 1;
    padding: 18px 12px;
    overflow-y: auto;
}

.menu-label {
    display: block;

    padding: 20px 12px 8px;

    color: var(--sidebar-text-muted);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.menu-item {
    min-height: 44px;

    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 3px;
    padding: 0 12px;

    border-radius: 7px;

    color: #dceefa;

    font-size: 14px;
    text-decoration: none;

    transition:
        background 0.15s,
        color 0.15s;
}

.menu-item:hover {
    background: rgba(185, 230, 255, 0.12);
    color: var(--sidebar-text);
}

.menu-item.active {
    background: var(--primary);
    color: var(--sidebar-text);
}

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 17px;
}

.sidebar-user {
    min-height: 70px;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 12px 16px;

    border-top: 1px solid rgba(185, 230, 255, 0.18);

    background: var(--sidebar-background);
}

.sidebar-user-profile {
    min-width: 0;
    flex: 1;

    display: flex;
    align-items: center;
    gap: 11px;

    color: inherit;
    text-decoration: none;
}

.sidebar-user-profile:hover .sidebar-user-data strong {
    text-decoration: underline;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--sidebar-background-alt);
    color: var(--sidebar-text);

    font-size: 13px;
    font-weight: 700;
}

.sidebar-user-data {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-data strong,
.sidebar-user-data span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-user-data strong {
    color: var(--sidebar-text);
    font-size: 13px;
}

.sidebar-user-data span {
    color: var(--sidebar-text-muted);
    font-size: 11px;
}

.sidebar-logout {
    margin-left: auto;

    color: var(--sidebar-text-muted);

    font-size: 18px;
    text-decoration: none;
}

.sidebar-logout:hover {
    color: var(--sidebar-text);
}

/* =========================================================
   MAIN / CONTENT
========================================================= */

.app-main {
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);

    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 24px;
}

.page-header h1 {
    margin-bottom: 5px;
    font-size: 24px;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    padding: 18px 28px;

    border-top: 1px solid var(--border);

    background: var(--surface);
    color: var(--text-light);

    font-size: 11px;
}

/* =========================================================
   MENU MOBILE
========================================================= */

.menu-toggle {
    display: none;
}

.menu-toggle-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.menu-toggle-dots span {
    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: currentColor;
}

.sidebar-overlay {
    display: none;

    position: fixed;
    inset: 0;
    z-index: 90;

    background: rgba(20, 57, 86, 0.48);
}

/* =========================================================
   LOGIN
========================================================= */

.login-body {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 24px;

    background: var(--background);
}

.login-card {
    width: min(420px, 100%);

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 26px;
}

.login-brand > div:last-child {
    display: flex;
    flex-direction: column;
}

.login-brand span {
    color: var(--text-light);
    font-size: 11px;
}

.login-card h1 {
    margin-bottom: 6px;
    font-size: 22px;
}

.login-card > p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 13px;
}

/* =========================================================
   RESPONSIVO ESTRUTURAL
========================================================= */

@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .app-main {
        width: 100%;
        margin-left: 0;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;

        display: flex;
        align-items: center;
        justify-content: center;

        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 85;

        border: 1px solid var(--border);
        border-radius: 50%;

        background: var(--surface);
        color: var(--text);

        box-shadow: var(--shadow);
        cursor: pointer;
    }

    .menu-toggle:hover {
        background: rgba(185, 230, 255, 0.45);
    }

    .content {
        padding: 72px 20px 20px;
    }
}

@media (max-width: 550px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer {
        flex-direction: column;
        gap: 5px;
    }
}
