:root {
    --header-height: 50px;
    --toolbar-width: 60px;
    --tab-height: 45px;
    --border-color: #dee2e6;
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --primary-color: #0d6efd;
}

.btn-xs {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 4px;
    min-width: 65px;
}

.main-nav {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Layout principal */
.main-wrapper {
    display: flex;
    height: calc(100vh - var(--header-height) - var(--tab-height));
    margin-top: var(--header-height);
}

/* Toolbar vertical */
.toolbar {
    width: var(--toolbar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.4rem;
    z-index: 900;
    flex-shrink: 0;
}

.toolbar-divider {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

.tool-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-color);
    transition: background 0.15s, border-color 0.15s;
}

.tool-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: var(--bg-color);
}

.tool-btn.active {
    background: #e7f1ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Canvas */
.canvas-container-wrapper {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Painel de propriedades */
.properties-panel {
    width: 220px;
    background: white;
    border-left: 1px solid var(--border-color);
    padding: 0.75rem;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
    overflow-y: auto;
}

/* Tabs de vistas */
.views-bar {
    height: var(--tab-height);
    background: white;
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    gap: 0.25rem;
    z-index: 1000;
    overflow-x: auto;
}

.tab {
    padding: 0.4rem 0.9rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.tab.active {
    background: white;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

/* Cards de vistas no modal */
.vistas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.vista-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--bg-color);
    user-select: none;
}

.vista-card input[type="checkbox"] {
    display: none !important;
}

.vista-card:has(input:checked) {
    border-color: var(--primary-color);
    background: #e7f1ff;
}

.vista-icone {
    font-size: 1.3rem;
    line-height: 1;
}

.vista-nome {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    .main-nav {
        flex-wrap: wrap;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        height: auto;
    }

    .navbar-brand {
        margin-bottom: 0.5rem;
    }

    .main-wrapper {
        flex-direction: column;
        height: calc(100vh - 100px); /* Ajuste dinâmico conforme necessário */
        margin-top: 0;
        padding-top: 100px; /* Espaço para o header que cresceu */
    }

    .toolbar {
        width: 100%;
        height: 50px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        overflow-x: auto;
        position: fixed;
        bottom: var(--tab-height);
        left: 0;
        padding: 0.25rem;
        gap: 0.25rem;
        z-index: 1000;
        background: white;
    }

    .tool-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .nav-buttons {
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 0.5rem;
    }

    .nav-buttons .btn {
        flex: 1;
        padding: 0.35rem 0.25rem;
        font-size: 0.65rem;
        min-width: auto;
    }
}