#automations-view {
    background-color: var(--sp-bg-main);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    /* JS toggles display: block/none, wrapper handles flex layout */
}

.automations-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#automations-grid-view {
    height: 100%;
    display: flex !important;
    /* Force Flex */
    flex-direction: column;
}

/* Automations Grid Layout */
.auto-grid-container {
    padding: 30px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    overflow-y: auto;
    flex: 1;
}

.auto-card {
    background-color: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    min-height: 200px;
}

.auto-card:hover {
    border-color: var(--sp-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.auto-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--sp-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auto-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--sp-text-main);
    margin: 0 0 8px 0;
}

.auto-card p {
    font-size: 14px;
    color: var(--sp-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Detail View Styles */
.btn-back {
    background: transparent;
    border: none;
    color: var(--sp-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-back:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sp-text-main);
}

.auto-detail-section {
    display: none;
    /* Hidden by default */
}

.auto-detail-section.active {
    display: block;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}